PHPUnit seems to execute properly (appropriate tests are executed & pass), but during code coverage an error is thrown. We are using PHPUnit 3.5 with ZF 1.11. Any insight would be greatly appreciated!
(FYI: I looked at some related StackOverflow posts, but nothing seemed to solve this issue for us.)
[24-Jan-2012 00:11:09 UTC] PHP Fatal error: Cannot redeclare class Zend_View_Helper_FormSpecial in /home/za/application/modules/proposal/views/helpers/FormSpecial.php on line 23
[24-Jan-2012 00:11:09 UTC] PHP Stack trace:
[24-Jan-2012 00:11:09 UTC] PHP 1. {main}() /usr/local/zend/bin/phpunit:0
[24-Jan-2012 00:11:09 UTC] PHP 2. PHPUnit_TextUI_Command::main() /usr/local/zend/bin/phpunit:49
[24-Jan-2012 00:11:09 UTC] PHP 3. PHPUnit_TextUI_Command->run() /usr/local/zend/share/pear/PHPUnit/TextUI/Command.php:129
[24-Jan-2012 00:11:09 UTC] PHP 4. PHPUnit_TextUI_TestRunner->doRun() /usr/local/zend/share/pear/PHPUnit/TextUI/Command.php:188
[24-Jan-2012 00:11:09 UTC] PHP 5. PHP_CodeCoverage_Report_HTML->process() /usr/local/zend/share/pear/PHPUnit/TextUI/TestRunner.php:363
[24-Jan-2012 00:11:09 UTC] PHP 6. PHP_CodeCoverage->getSummary() /usr/local/zend/share/pear/PHP/CodeCoverage/Report/HTML.php:128
[24-Jan-2012 00:11:09 UTC] PHP 7. PHP_CodeCoverage->processUncoveredFilesFromWhitelist() /usr/local/zend/share/pear/PHP/CodeCoverage.php:354
Thanks!
Chris
The error means that /home/za/application/modules/proposal/views/helpers/FormSpecial.php is declaring a class named Zend_View_Helper_FormSpecial which is already declared by some other module--probably .../Zend/View/Helper/FormSpecial.php in the Zend Framework. If you intended to replace Zend's FormSpecial with your own, you need to give it a different class name.
The problem is that PHP_CodeCoverage will load every PHP file in the whitelist that hasn't already been loaded. If one of those modules defines a class with the same name, you get this error.
Related
I am currently using word press latest version. It was working fine yesterday but when i login again today. And when i upload image in the media library it gives this error that
An error occurred in the upload. Please try again later. wordpress
Also my uploaded images are not showing. I have searched for this. My short tags are also on.
[25-Mar-2016 11:50:46 UTC] PHP 1. {main}() E:\designbee\lifeco\wordpress\index.php:0
[25-Mar-2016 11:50:46 UTC] PHP 2. require() E:\designbee\lifeco\wordpress\index.php:17
[25-Mar-2016 11:50:46 UTC] PHP 3. require_once() E:\designbee\lifeco\wordpress\wp-blog-header.php:12
[25-Mar-2016 11:50:46 UTC] PHP 4. require_once() E:\designbee\lifeco\wordpress\wp-load.php:37
[25-Mar-2016 11:50:46 UTC] PHP 5. require_once() E:\designbee\lifeco\wordpress\wp-config.php:89
[25-Mar-2016 11:50:46 UTC] PHP 6. do_action() E:\designbee\lifeco\wordpress\wp-settings.php:376
[25-Mar-2016 11:50:46 UTC] PHP 7. call_user_func_array: {E:\designbee\lifeco\wordpress\wp-includes\plugin.php:525}() E:\designbee\lifeco\wordpress\wp-includes\plugin.php:525
[25-Mar-2016 11:50:46 UTC] PHP 8. lifeco_setup() E:\designbee\lifeco\wordpress\wp-includes\plugin.php:525
this is my log file (Last portion)
There was a div outside of the function in my custom post type.
I am using the latest WAMPServer64 with PHP 5.5.12.
What I did: From a webserver (runs PHP 5.4.16) I have copied the modx folders to localhost, then I copied the entire database. I have also changed the database credentials accordingly via manager/includes/confic.inc.php.
When opening the manager login, I see the following:
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in \manager\includes\extenders\dbapi.mysql.class.inc.php on line 93
When I try to login, the manager does not show up and I get a bunch of errors, content of php_error.log:
PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in manager\includes\extenders\dbapi.mysql.class.inc.php on line 93
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP 2. DBAPI->escape() manager\processors\login.processor.php:51
PHP 3. DBAPI->connect() manager\includes\extenders\dbapi.mysql.class.inc.php:156
PHP 4. mysql_connect() manager\includes\extenders\dbapi.mysql.class.inc.php:93
PHP Notice: Undefined index: captcha_code in manager\processors\login.processor.php on line 53
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP Notice: Undefined index: rememberme in manager\processors\login.processor.php on line 54
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP Notice: Undefined variable: allowed_ip in manager\processors\login.processor.php on line 134
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP Notice: Undefined variable: allowed_days in manager\processors\login.processor.php on line 148
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP Notice: Undefined variable: newloginerror in manager\processors\login.processor.php on line 224
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP Warning: Cannot modify header information - headers already sent by (output started at manager\processors\login.processor.php:54) in manager\processors\login.processor.php on line 298
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP 2. setcookie() manager\processors\login.processor.php:298
PHP Notice: Undefined variable: sql in manager\includes\extenders\dbapi.mysql.class.inc.php on line 276
PHP Stack trace:
PHP 1. {main}() manager\processors\login.processor.php:0
PHP 2. logHandler->initAndWriteLog() manager\processors\login.processor.php:302
PHP 3. logHandler->writeToLog() manager\includes\log.class.inc.php:42
PHP 4. DBAPI->insert() manager\includes\log.class.inc.php:76
I have searched for solutions on the net, some suggested to clear the cache, which is not directly possible since the manager interface does not load. I also tried to upgrade using the default install folder, same problem remains.
So if anyone has a clue how I can solve this without installing an old version of PHP, that would be great.
To get rid of the mysql deprecated warning you have to use Evo 1.0.15+ and you should change
$database_type = 'mysql';
to
$database_type = 'mysqli';
in config.inc.php
The 'only' thing that uses the old mysql_ functions is the installer then. The deprecated warnings are disabled in there for PHP 5.5.
MODx Evolution has a lot of old code in it. As you see by your warnings it is using deprecated mysql-functions. This is long known in the MODx Forums.
As for now you have two possible solutions:
Downgrade your local php version via WAMP to some (best, the same) PHP 5.4 version.
Change your PHP error-reporting level (inside the affected files or in your php.ini) to omit deprecated errors, as long as Evo has this issue.
Can check following solution
https://toster.ru/q/125593
really works !
:)
I'm currently reading the "Easy PHP Websites with the Zend Framework". At some point, it introduces Doctrine and gives a src code along with an text on how to install stuff properly.
I've followed all the steps correctly, but in one you have to use a "seed.php" which reads some ASINs and loads some amazon product details into the databass.
However, executing the script gives me errors, and it seems like it can't locate a file.
PHP Warning: include_once(WJG\Controller\Action\Helper\Initializer.php): failed to
open stream: No such file or directory in
C:\Programming\zend\library\Zend\L oader.php on line 134 PHP Stack
trace: PHP
1. {main}() C:\wamp\www\webclass\application\scripts\seed.php:0 PHP
2. include() C:\wamp\www\webclass\application\scripts\seed.php:9 PHP
3. Zend_Application->bootstrap() C:\wamp\www\webclass\public\cli.php:20
4. Zend_Application_Bootstrap_BootstrapAbstract->bootstrap() C:\Programmin g\zend\library\Zend\Application.php:355 PHP
5. Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap()
C:\Programmi
ng\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.php:586
PHP
6.Zend_Application_Bootstrap_BootstrapAbstract->_executeResource()
C:\Pro
gramming\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.php:622
PHP
7. Bootstrap->_initGlobalVars() C:\Programming\zend\library\Zend\Applicati
on\Bootstrap\BootstrapAbstract.php:669 PHP
8.Zend_Loader_Autoloader::autoload()
C:\Programming\zend\library\Zend\App
lication\Bootstrap\BootstrapAbstract.php:0 PHP
9. call_user_func() C:\Programming\zend\library\Zend\Loader\Autoloader.php :124 PHP
10.Zend_Loader_Autoloader->_autoload()
C:\Programming\zend\library\Zend\Lo ader\Autoloader.php:124 PHP
11. call_user_func()
C:\Programming\zend\library\Zend\Loader\Autoloader.php :479 PHP
12. Zend_Loader::loadClass()
C:\Programming\zend\library\Zend\Loader\Autolo ader.php:479 PHP
13. Zend_Loader::loadFile() C:\Programming\zend\library\Zend\Loader.php:82
Warning: include_once(WJG\Controller\Action\Helper\Initializer.php):
failed to o pen stream: No such file or directory in
C:\Programming\zend\library\Zend\Loader .php on line 134
Call Stack:
0.0004 651544 1. {main}() C:\wamp\www\webclass\application\scripts\see d.php:0
0.0006 661568 2. include('C:\wamp\www\webclass\public\cli.php') C:\wam
p\www\webclass\application\scripts\seed.php:9
0.0121 2052384 3. Zend_Application->bootstrap() C:\wamp\www\webclass\pu blic\cli.php:20
0.0121 2052432 4. Zend_Application_Bootstrap_BootstrapAbstract->bootstr ap()
C:\Programming\zend\library\Zend\Application.php:355
0.0121 2052432 5. Zend_Application_Bootstrap_BootstrapAbstract->_bootst rap()
C:\Programming\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.p
hp:586
0.0190 3235544 6. Zend_Application_Bootstrap_BootstrapAbstract->_execut eResource()
C:\Programming\zend\library\Zend\Application\Bootstrap\BootstrapAbst
ract.php:622
0.0190 3235768 7. Bootstrap->_initGlobalVars() C:\Programming\zend\libr
ary\Zend\Application\Bootstrap\BootstrapAbstract.php:669
0.0190 3236432 8. Zend_Loader_Autoloader::autoload() C:\Programming\zen
d\library\Zend\Application\Bootstrap\BootstrapAbstract.php:0
0.0191 3236768 9. call_user_func() C:\Programming\zend\library\Zend\Loa der\Autoloader.php:124
0.0191 3236800 10. Zend_Loader_Autoloader->_autoload() C:\Programming\ze nd\library\Zend\Loader\Autoloader.php:124
0.0191 3236848 11. call_user_func() C:\Programming\zend\library\Zend\Loa der\Autoloader.php:479
0.0191 3236880 12. Zend_Loader::loadClass() C:\Programming\zend\library\ Zend\Loader\Autoloader.php:479
0.0191 3237136 13. Zend_Loader::loadFile() C:\Programming\zend\library\Z end\Loader.php:82
PHP Warning: include_once(): Failed opening
'WJG\Controller\Action\Helper\Initi alizer.php' for inclusion
(include_path='C:\wamp\www\webclass\application/../vie
ws;.;C:\wamp\bin\php\php5.3.13\pear;c:\php\includes;C:\Programming\zend\library;
C:\wamp\bin\php\php5.3.13\pear\PEAR') in
C:\Programming\zend\library\Zend\Loader .php on line 134 PHP Stack
trace: PHP 1. {main}()
C:\wamp\www\webclass\application\scripts\seed.php:0 PHP 2. include()
C:\wamp\www\webclass\application\scripts\seed.php:9 PHP 3.
Zend_Application->bootstrap() C:\wamp\www\webclass\public\cli.php:20
PHP 4. Zend_Application_Bootstrap_BootstrapAbstract->bootstrap()
C:\Programmin g\zend\library\Zend\Application.php:355 PHP 5.
Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap()
C:\Programmi
ng\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.php:586
PHP 6.
Zend_Application_Bootstrap_BootstrapAbstract->_executeResource()
C:\Pro
gramming\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.php:622
PHP 7. Bootstrap->_initGlobalVars()
C:\Programming\zend\library\Zend\Applicati
on\Bootstrap\BootstrapAbstract.php:669 PHP 8.
Zend_Loader_Autoloader::autoload()
C:\Programming\zend\library\Zend\App
lication\Bootstrap\BootstrapAbstract.php:0 PHP 9. call_user_func()
C:\Programming\zend\library\Zend\Loader\Autoloader.php :124 PHP 10.
Zend_Loader_Autoloader->_autoload()
C:\Programming\zend\library\Zend\Lo ader\Autoloader.php:124 PHP 11.
call_user_func()
C:\Programming\zend\library\Zend\Loader\Autoloader.php :479 PHP 12.
Zend_Loader::loadClass()
C:\Programming\zend\library\Zend\Loader\Autolo ader.php:479 PHP 13.
Zend_Loader::loadFile() C:\Programming\zend\library\Zend\Loader.php:82
Warning: include_once(): Failed opening
'WJG\Controller\Action\Helper\Initialize r.php' for inclusion
(include_path='C:\wamp\www\webclass\application/../views;.;
C:\wamp\bin\php\php5.3.13\pear;c:\php\includes;C:\Programming\zend\library;C:\wa
mp\bin\php\php5.3.13\pear\PEAR') in
C:\Programming\zend\library\Zend\Loader.php on line 134
Call Stack:
0.0004 651544 1. {main}() C:\wamp\www\webclass\application\scripts\see d.php:0
0.0006 661568 2. include('C:\wamp\www\webclass\public\cli.php') C:\wam
p\www\webclass\application\scripts\seed.php:9
0.0121 2052384 3. Zend_Application->bootstrap() C:\wamp\www\webclass\pu blic\cli.php:20
0.0121 2052432 4. Zend_Application_Bootstrap_BootstrapAbstract->bootstr ap()
C:\Programming\zend\library\Zend\Application.php:355
0.0121 2052432 5. Zend_Application_Bootstrap_BootstrapAbstract->_bootst rap()
C:\Programming\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.p
hp:586
0.0190 3235544 6. Zend_Application_Bootstrap_BootstrapAbstract->_execut eResource()
C:\Programming\zend\library\Zend\Application\Bootstrap\BootstrapAbst
ract.php:622
0.0190 3235768 7. Bootstrap->_initGlobalVars() C:\Programming\zend\libr
ary\Zend\Application\Bootstrap\BootstrapAbstract.php:669
0.0190 3236432 8. Zend_Loader_Autoloader::autoload() C:\Programming\zen
d\library\Zend\Application\Bootstrap\BootstrapAbstract.php:0
0.0191 3236768 9. call_user_func() C:\Programming\zend\library\Zend\Loa der\Autoloader.php:124
0.0191 3236800 10. Zend_Loader_Autoloader->_autoload() C:\Programming\ze nd\library\Zend\Loader\Autoloader.php:124
0.0191 3236848 11. call_user_func() C:\Programming\zend\library\Zend\Loa der\Autoloader.php:479
0.0191 3236880 12. Zend_Loader::loadClass() C:\Programming\zend\library\ Zend\Loader\Autoloader.php:479
0.0191 3237136 13. Zend_Loader::loadFile() C:\Programming\zend\library\Z end\Loader.php:82
PHP Fatal error: Class 'WJG_Controller_Action_Helper_Initializer' not
found in C:\wamp\www\webclass\application\Bootstrap.php on line 39 PHP
Stack trace: PHP 1. {main}()
C:\wamp\www\webclass\application\scripts\seed.php:0 PHP 2. include()
C:\wamp\www\webclass\application\scripts\seed.php:9 PHP 3.
Zend_Application->bootstrap() C:\wamp\www\webclass\public\cli.php:20
PHP 4. Zend_Application_Bootstrap_BootstrapAbstract->bootstrap()
C:\Programmin g\zend\library\Zend\Application.php:355 PHP 5.
Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap()
C:\Programmi
ng\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.php:586
PHP 6.
Zend_Application_Bootstrap_BootstrapAbstract->_executeResource()
C:\Pro
gramming\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.php:622
PHP 7. Bootstrap->_initGlobalVars()
C:\Programming\zend\library\Zend\Applicati
on\Bootstrap\BootstrapAbstract.php:669
Fatal error: Class 'WJG_Controller_Action_Helper_Initializer' not
found in C:\wa mp\www\webclass\application\Bootstrap.php on line 39
Call Stack:
0.0004 651544 1. {main}() C:\wamp\www\webclass\application\scripts\see d.php:0
0.0006 661568 2. include('C:\wamp\www\webclass\public\cli.php') C:\wam
p\www\webclass\application\scripts\seed.php:9
0.0121 2052384 3. Zend_Application->bootstrap() C:\wamp\www\webclass\pu blic\cli.php:20
0.0121 2052432 4. Zend_Application_Bootstrap_BootstrapAbstract->bootstr ap()
C:\Programming\zend\library\Zend\Application.php:355
0.0121 2052432 5. Zend_Application_Bootstrap_BootstrapAbstract->_bootst rap()
C:\Programming\zend\library\Zend\Application\Bootstrap\BootstrapAbstract.p
hp:586
0.0190 3235544 6. Zend_Application_Bootstrap_BootstrapAbstract->_execut eResource()
C:\Programming\zend\library\Zend\Application\Bootstrap\BootstrapAbst
ract.php:622
0.0190 3235768 7. Bootstrap->_initGlobalVars() C:\Programming\zend\libr
ary\Zend\Application\Bootstrap\BootstrapAbstract.php:669
This is the error, and here is the _initGlobalVars()
protected function _initGlobalVars()
{
Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH.'/../library/WJG/Controller/Action/Helper');
$initializer = Zend_Controller_Action_HelperBroker::addHelper(
new WJG_Controller_Action_Helper_Initializer());
}
If you want some more info ask me, please help me because I really want to continue with the flow of the book, thanks!
You need to add prefix to the path:
Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH.'/../library/WJG/Controller/Action/Helper');
add then:
Zend_Controller_Action_HelperBroker::addPrefix("WJG_Controller_Action_Helper_");
Hope this helps :)
I updated my vendors on symfony2, and after I began to got this error, I have no idea why it appears
uan#juan-VirtualBox:/var/www/msw-web$ php app/console doctrine:migrations:diff
PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0
PHP Fatal error: Call to undefined method Doctrine\DBAL\Configuration::getFilterSchemaAssetsExpression() in /var/www/msw-web/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/DiffCommand.php on line 85
PHP Stack trace:
PHP 1. {main}() /var/www/msw-web/app/console:0
PHP 2. Symfony\Component\Console\Application->run() /var/www/msw-web/app/console:22
PHP 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /var/www/msw-web/vendor/symfony/src/Symfony/Component/Console/Application.php:118
PHP 4. Symfony\Component\Console\Application->doRun() /var/www/msw-web/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:75
PHP 5. Symfony\Component\Console\Command\Command->run() /var/www/msw-web/vendor/symfony/src/Symfony/Component/Console/Application.php:194
PHP 6. Symfony\Bundle\DoctrineMigrationsBundle\Command\MigrationsDiffDoctrineCommand->execute() /var/www/msw-web/vendor/symfony/src/Symfony/Component/Console/Command/Command.php:224
PHP 7. Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand->execute() /var/www/msw-web/vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/Command/MigrationsDiffDoctrineCommand.php:46
Fatal error: Call to undefined method Doctrine\DBAL\Configuration::getFilterSchemaAssetsExpression() in /var/www/msw-web/vendor/doctrine-migrations/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/DiffCommand.php on line 85
Call Stack:
0.0003 328524 1. {main}() /var/www/msw-web/app/console:0
0.0210 1930264 2. Symfony\Component\Console\Application->run() /var/www/msw-web/app/console:22
0.0289 2110852 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /var/www/msw-web/vendor/symfony/src/Symfony/Component/Console/Application.php:118
0.1349 7697284 4. Symfony\Component\Console\Application->doRun() /var/www/msw-web/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:75
0.1422 7697284 5. Symfony\Component\Console\Command\Command->run() /var/www/msw-web/vendor/symfony/src/Symfony/Component/Console/Application.php:194
0.1432 7697828 6. Symfony\Bundle\DoctrineMigrationsBundle\Command\MigrationsDiffDoctrineCommand->execute() /var/www/msw-web/vendor/symfony/src/Symfony/Component/Console/Command/Command.php:224
0.1767 11022484 7. Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand->execute() /var/www/msw-web/vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle/Command/MigrationsDiffDoctrineCommand.php:46
juan#juan-VirtualBox:/var/www/msw-web$
I am not sure if the problem came from Doctrine.
I tryed to update doctrine dbal, I used on mi file deps
doctrine-common
git=http://github.com/doctrine/common.git
version=2.2.1
doctrine-dbal
git=http://github.com/doctrine/dbal.git
version=2.2.1
doctrine
git=http://github.com/doctrine/doctrine2.git
version=2.2.1
But I get the same error because when I reinstall vendor it download the version 2.1.X
What can I do?
Regards.
set commit version value in deps file
[doctrine-migrations]
git=http://github.com/doctrine/migrations.git
version=b86b4cc0a39714f0aa53b908d495beacfa0e4011
You should check which version of Doctrine/DBAL do you have. Probably you have incompatibile versions of DoctrineMigrations and DoctrineDBAL.
Method 'getFilterSchemaAssetsExpression` was added in 2.2 IIRC.
See that commit
I have a PHPUnit test suite that is currently causing a fatal error due to a class definition that's not being found. This, ultimately, is a failure of the testing code itself and a failure by the developer to vindicate the test itself before committing code.
However, things like this do happen from time to time, and it would be wonderful if, when a fatal error occurs (regardless of who's ultimately responsible), the test simply be marked as a failure, and the remainder of the test suite still be executed.
I have read about the --process-isolation switch and as far as I can tell, it should take care of this. Since each test runs in a separate process, if the child dies due to a fatal error, the parent can still continue to run. In fact, this is stated explicitly in this answer to a similar question: https://stackoverflow.com/a/5340151/84762 which shows the exact type of output I would like to see myself.
However, I seem to get the exact same output regardless of whether or not I use the --process-isolation flag:
WITHOUT process isolation
[kogi#phagocyte ~]$ /usr/bin/phpunit --colors --verbose --coverage-html "target/coverage" ~/app/zend/tests/application/
PHP Fatal error: Class 'Rmd_Database_OldObject' not found in /home/kogi/app/zend/private/models/translate/Poll.php on line 9
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP 3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:130
PHP 4. PHPUnit_Runner_BaseTestRunner->getTest() /usr/share/pear/PHPUnit/TextUI/Command.php:150
PHP 5. PHPUnit_Framework_TestSuite->addTestFiles() /usr/share/pear/PHPUnit/Runner/BaseTestRunner.php:96
PHP 6. PHPUnit_Framework_TestSuite->addTestFile() /usr/share/pear/PHPUnit/Framework/TestSuite.php:419
PHP 7. PHPUnit_Util_Fileloader::checkAndLoad() /usr/share/pear/PHPUnit/Framework/TestSuite.php:358
PHP 8. PHPUnit_Util_Fileloader::load() /usr/share/pear/PHPUnit/Util/Fileloader.php:79
PHP 9. include_once() /usr/share/pear/PHPUnit/Util/Fileloader.php:95
PHP 10. require_once() /home/kogi/app/zend/tests/application/translate/PollTest.php:11
Fatal error: Class 'Rmd_Database_OldObject' not found in /home/kogi/app/zend/private/models/translate/Poll.php on line 9
Call Stack:
0.0003 91584 1. {main}() /usr/bin/phpunit:0
0.0076 612672 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
0.0076 613744 3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:130
0.0246 1249464 4. PHPUnit_Runner_BaseTestRunner->getTest() /usr/share/pear/PHPUnit/TextUI/Command.php:150
0.0706 1626680 5. PHPUnit_Framework_TestSuite->addTestFiles() /usr/share/pear/PHPUnit/Runner/BaseTestRunner.php:96
0.1691 8053584 6. PHPUnit_Framework_TestSuite->addTestFile() /usr/share/pear/PHPUnit/Framework/TestSuite.php:419
0.1693 8057320 7. PHPUnit_Util_Fileloader::checkAndLoad() /usr/share/pear/PHPUnit/Framework/TestSuite.php:358
0.1694 8057664 8. PHPUnit_Util_Fileloader::load() /usr/share/pear/PHPUnit/Util/Fileloader.php:79
0.1711 8240600 9. include_once('/home/kogi/app/zend/tests/application/translate/PollTest.php') /usr/share/pear/PHPUnit/Util/Fileloader.php:95
0.1805 9187768 10. require_once('/home/kogi/app/zend/private/models/translate/Poll.php') /home/kogi/app/zend/tests/application/translate/PollTest.php:11
WITH process isolation
[kogi#phagocyte ~]$ /usr/bin/phpunit --colors --verbose --coverage-html "target/coverage" --process-isolation ~/app/zend/tests/application/
PHP Fatal error: Class 'Rmd_Database_OldObject' not found in /home/kogi/app/zend/private/models/translate/Poll.php on line 9
PHP Stack trace:
PHP 1. {main}() /usr/bin/phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP 3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:130
PHP 4. PHPUnit_Runner_BaseTestRunner->getTest() /usr/share/pear/PHPUnit/TextUI/Command.php:150
PHP 5. PHPUnit_Framework_TestSuite->addTestFiles() /usr/share/pear/PHPUnit/Runner/BaseTestRunner.php:96
PHP 6. PHPUnit_Framework_TestSuite->addTestFile() /usr/share/pear/PHPUnit/Framework/TestSuite.php:419
PHP 7. PHPUnit_Util_Fileloader::checkAndLoad() /usr/share/pear/PHPUnit/Framework/TestSuite.php:358
PHP 8. PHPUnit_Util_Fileloader::load() /usr/share/pear/PHPUnit/Util/Fileloader.php:79
PHP 9. include_once() /usr/share/pear/PHPUnit/Util/Fileloader.php:95
PHP 10. require_once() /home/kogi/app/zend/tests/application/translate/PollTest.php:11
Fatal error: Class 'Rmd_Database_OldObject' not found in /home/kogi/app/zend/private/models/translate/Poll.php on line 9
Call Stack:
0.0003 91752 1. {main}() /usr/bin/phpunit:0
0.0076 612824 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
0.0076 613896 3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:130
0.0246 1250360 4. PHPUnit_Runner_BaseTestRunner->getTest() /usr/share/pear/PHPUnit/TextUI/Command.php:150
0.0708 1627528 5. PHPUnit_Framework_TestSuite->addTestFiles() /usr/share/pear/PHPUnit/Runner/BaseTestRunner.php:96
0.1688 8054296 6. PHPUnit_Framework_TestSuite->addTestFile() /usr/share/pear/PHPUnit/Framework/TestSuite.php:419
0.1690 8057992 7. PHPUnit_Util_Fileloader::checkAndLoad() /usr/share/pear/PHPUnit/Framework/TestSuite.php:358
0.1691 8058336 8. PHPUnit_Util_Fileloader::load() /usr/share/pear/PHPUnit/Util/Fileloader.php:79
0.1707 8241296 9. include_once('/home/kogi/app/zend/tests/application/translate/PollTest.php') /usr/share/pear/PHPUnit/Util/Fileloader.php:95
0.1801 9188464 10. require_once('/home/kogi/app/zend/private/models/translate/Poll.php') /home/kogi/app/zend/tests/application/translate/PollTest.php:11
For those of us that can't effectively diff in our heads, the two outputs are literally identical (other than the execution time and memory usage which is negligibly different).
In both cases, the fatal error kills the entire test suite. In this particular case, this happens in the 3rd test and the remaining 150 tests (in several other files/suites) are never executed.
What am I doing wrong here? Is there some other way to survive a fatal error (marking the test as failed) in one test and still execute remaining tests?
EDIT
I am using PHPUnit 3.6.10
EDIT
Comments on the answer to this question have inspired a new ticket on PHPUnit's GitHub page: https://github.com/sebastianbergmann/phpunit/issues/545
PHPUnit loads each test file that will be run before running any tests. This causes PHP to parse these files and execute their top-level code. If any class is loaded that, for example, extends a class that doesn't exist, you'll get a fatal error.
I don't see any way around this without enhancing PHPUnit to parse the files without executing their code during the scanning process.