Skip to content
This repository was archived by the owner on Dec 9, 2023. It is now read-only.

Commit 0893a0b

Browse files
derrabusfabpot
authored andcommitted
Modernized deprecated PHPUnit assertion calls
1 parent 7ce874f commit 0893a0b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Tests/DebugClassLoaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ class ChildTestingStacking extends TestingStacking { function foo($bar) {} }
128128
// if an exception is thrown, the test passed
129129
$this->assertStringStartsWith(__FILE__, $exception->getFile());
130130
if (\PHP_VERSION_ID < 70000) {
131-
$this->assertRegExp('/^Runtime Notice: Declaration/', $exception->getMessage());
131+
$this->assertMatchesRegularExpression('/^Runtime Notice: Declaration/', $exception->getMessage());
132132
$this->assertEquals(E_STRICT, $exception->getSeverity());
133133
} else {
134-
$this->assertRegExp('/^Warning: Declaration/', $exception->getMessage());
134+
$this->assertMatchesRegularExpression('/^Warning: Declaration/', $exception->getMessage());
135135
$this->assertEquals(E_WARNING, $exception->getSeverity());
136136
}
137137
} finally {

Tests/ErrorHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ public function testNotice()
103103
// if an exception is thrown, the test passed
104104
if (\PHP_VERSION_ID < 80000) {
105105
$this->assertEquals(E_NOTICE, $exception->getSeverity());
106-
$this->assertRegExp('/^Notice: Undefined variable: (foo|bar)/', $exception->getMessage());
106+
$this->assertMatchesRegularExpression('/^Notice: Undefined variable: (foo|bar)/', $exception->getMessage());
107107
} else {
108108
$this->assertEquals(E_WARNING, $exception->getSeverity());
109-
$this->assertRegExp('/^Warning: Undefined variable \$(foo|bar)/', $exception->getMessage());
109+
$this->assertMatchesRegularExpression('/^Warning: Undefined variable \$(foo|bar)/', $exception->getMessage());
110110
}
111111
$this->assertEquals(__FILE__, $exception->getFile());
112112

Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function testHandleClassNotFound($error, $translatedMessage, $autoloader
6565
}
6666

6767
$this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $exception);
68-
$this->assertRegExp($translatedMessage, $exception->getMessage());
68+
$this->assertMatchesRegularExpression($translatedMessage, $exception->getMessage());
6969
$this->assertSame($error['type'], $exception->getSeverity());
7070
$this->assertSame($error['file'], $exception->getFile());
7171
$this->assertSame($error['line'], $exception->getLine());

0 commit comments

Comments
 (0)