10000 minor #14566 [Debug 2.3] Fix test for PHP7 (nicolas-grekas) · symfony/symfony@6e314dc · GitHub
[go: up one dir, main page]

Skip to content

Commit 6e314dc

Browse files
minor #14566 [Debug 2.3] Fix test for PHP7 (nicolas-grekas)
This PR was merged into the 2.3 branch. Discussion ---------- [Debug 2.3] Fix test for PHP7 | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- fafcb64 [Debug 2.3] Fix test for PHP7
2 parents b77d8c5 + fafcb64 commit 6e314dc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,14 @@ class_exists('PHPUnit_Framework_MockObject_Invocation_Object');
5959
$that = $this;
6060
$exceptionCheck = function ($exception) use ($that) {
6161
$that->assertInstanceOf('Symfony\Component\Debug\Exception\ContextErrorException', $exception);
62-
$that->assertEquals(E_STRICT, $exception->getSeverity());
6362
$that->assertEquals(2, $exception->getLine());
64-
$that->assertStringStartsWith('Runtime Notice: Declaration of _CompileTimeError::foo() should be compatible with', $exception->getMessage());
63+
if (PHP_VERSION_ID < 70000) {
64+
$that->assertEquals(E_STRICT, $exception->getSeverity());
65+
$that->assertStringStartsWith('Runtime Notice: Declaration of _CompileTimeError::foo() should be compatible with', $exception->getMessage());
66+
} else {
67+
$that->assertEquals(E_WARNING, $exception->getSeverity());
68+
$that->assertStringStartsWith('Warning: Declaration of _CompileTimeError::foo() should be compatible with', $exception->getMessage());
69+
}
6570
$that->assertArrayHasKey('bar', $exception->getContext());
6671
};
6772

0 commit comments

Comments
 (0)
0