Class 'PHPUnit_Framework_Error_Notice' not found #125

Closed
Systho opened this Issue Jan 19, 2011 · 1 comment

Comments

Projects
None yet
2 participants

Systho commented Jan 19, 2011

The TestResult class sets the error handler with the following line :

$oldErrorHandler = set_error_handler(
    array('PHPUnit_Util_ErrorHandler', 'handleError'),
    E_ALL | E_STRICT
);

Unfortunately, this way of setting the error handler deactivate the autoloading for compile time errorsthus preventing the class PHPUnit_Framework_Error_Notice to be loaded on line 97.

when the value of convertNoticeToException is true this class has not been loaded firstly by TestRunner::doRun() and thus when ErrorHandler tries to load the class it can't find it because autoloader is deactivated.

I guess the best workaround is to load PHPUnit_Framework_Error_Notice in TestRunner::doRun() wether the param is true or false.

See http://bugs.php.net/bug.php?id=47987 for details.

Closed by fbcba13.

@cebe cebe pushed a commit to cebe/phpunit that referenced this issue Aug 15, 2011

@sebastianbergmann sebastianbergmann Close #125. fbcba13

@greglamb greglamb pushed a commit to greglamb/phpunit that referenced this issue Apr 19, 2013

@sebastianbergmann sebastianbergmann Close #125. bc26aed

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment