[ 'Class \'Foo\\Bar\\UndefinedFunctionError\' not found',
"Attempted to load class \"UndefinedFunctionError\" from namespace \"Foo\\Bar\".\nDid you forget a \"use\" statement for another namespace?",
function D
$className) { /* do nothing here */
},
],
];
} public function testEnhanceWithFatalError() { $error =
(new ClassNotFoundErrorEnhancer())->
enhance(new FatalError('foo', 0,
[ 'type' => \E_ERROR,
'message' => "Class 'FooBarCcc' not found",
'file' =>
$expectedFile =
realpath(__FILE__
),
'line' =>
$expectedLine = __LINE__,
]));
$this->
assertInstanceOf(ClassNotFoundError::
class,
$error);
$this->
assertSame("Attempted to load class \"FooBarCcc\" from the global namespace.\nDid you forget a \"use\" statement?",
$error->
getMessage());
$this->
assertSame($expectedFile,
$error->
getFile());
$this->
assertSame($expectedLine,
$error->
getLine());
}