Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a53e0fe

Browse filesBrowse files
committed
Use a class name that does not actually exist
Using "Foo", a class name that corresponds to no less than 22 fixture classes, results in the first found "Foo" being loaded when one is found by the ClassNotFoundFatalErrorHandler error handler, I am not sure exactly why, but it is not really a big issue because this is a fatal error handler and execution is not supposed to continue after that. Except that is very much the case when running the whole test suite sequentially with ./phpunit . Then we arrive to the DI component test suite, and a failure happens because \\foo was not supposed to be defined: > Failed asserting that exception message 'The definition for "\foo" has > no class attribute, and appears to reference a class or interface in the > global namespace. Leaving out the "class" attribute is only allowed for > namespaced classes. Please specify the class attribute explicitly to get > rid of this error.' contains 'The definition for "\foo" has no class.'.
1 parent 3e0b235 commit a53e0fe
Copy full SHA for a53e0fe

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ public function testHandleFatalError()
525525
*/
526526
public function testHandleErrorException()
527527
{
528-
$exception = new \Error("Class 'Foo' not found");
528+
$exception = new \Error("Class 'IReallyReallyDoNotExistAnywhereInTheRepositoryISwear' not found");
529529

530530
$handler = new ErrorHandler();
531531
$handler->setExceptionHandler(function () use (&$args) {
@@ -535,7 +535,7 @@ public function testHandleErrorException()
535535
$handler->handleException($exception);
536536

537537
$this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $args[0]);
538-
$this->assertStringStartsWith("Attempted to load class \"Foo\" from the global namespace.\nDid you forget a \"use\" statement", $args[0]->getMessage());
538+
$this->assertStringStartsWith("Attempted to load class \"IReallyReallyDoNotExistAnywhereInTheRepositoryISwear\" from the global namespace.\nDid you forget a \"use\" statement", $args[0]->getMessage());
539539
}
540540

541541
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.