8000 Use a class name that does not actually exist · symfony/symfony@a53e0fe · GitHub
[go: up one dir, main page]

Skip to content
10000

Commit a53e0fe

Browse 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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines 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