php-code-coverage icon indicating copy to clipboard operation
php-code-coverage copied to clipboard

PHPUnit 3.6.0RC1 gives errors on PHP_Code_Coverage

Open tombevers opened this issue 15 years ago • 6 comments

Hi,

I was testing PHPUnit 3.6.0RC1 for our test suite and I got following errors on PHP_Code_Coverage which also has been upgraded.

Warning: Missing argument 1 for text_template_autoload(), called in /usr/share/php/PHP/CodeCoverage.php on line 555 and defined in /usr/share/php/Text/Template/Autoload.php on line 46

Call Stack: 0.0002 638216 1. {main}() /usr/bin/phpunit:0 0.0038 1307808 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46 0.0038 1308680 3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:125 0.1458 17232656 4. PHPUnit_TextUI_Command->createRunner() /usr/share/php/PHPUnit/TextUI/Command.php:136 0.1473 17537008 5. PHPUnit_TextUI_TestRunner->__construct() /usr/share/php/PHPUnit/TextUI/Command.php:213 0.1481 17701096 6. PHP_CodeCoverage->__construct() /usr/share/php/PHPUnit/TextUI/TestRunner.php:91 0.1487 17785944 7. PHP_CodeCoverage->prefillBlacklist() /usr/share/php/PHP/CodeCoverage.php:129 0.1532 17864592 8. text_template_autoload() /usr/share/php/PHP/CodeCoverage.php:555

Notice: Undefined variable: class in /usr/share/php/Text/Template/Autoload.php on line 58

Call Stack: 0.0002 638216 1. {main}() /usr/bin/phpunit:0 0.0038 1307808 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46 0.0038 1308680 3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:125 0.1458 17232656 4. PHPUnit_TextUI_Command->createRunner() /usr/share/php/PHPUnit/TextUI/Command.php:136 0.1473 17537008 5. PHPUnit_TextUI_TestRunner->__construct() /usr/share/php/PHPUnit/TextUI/Command.php:213 0.1481 17701096 6. PHP_CodeCoverage->__construct() /usr/share/php/PHPUnit/TextUI/TestRunner.php:91 0.1487 17785944 7. PHP_CodeCoverage->prefillBlacklist() /usr/share/php/PHP/CodeCoverage.php:129 0.1532 17864592 8. text_template_autoload() /usr/share/php/PHP/CodeCoverage.php:555

Catchable fatal error: Argument 1 passed to PHP_CodeCoverage_Filter::addFilesToBlacklist() must be an array, null given, called in /usr/share/php/PHP/CodeCoverage.php on line 555 and defined in /usr/share/php/PHP/CodeCoverage/Filter.php on line 108

Call Stack: 0.0002 638216 1. {main}() /usr/bin/phpunit:0 0.0038 1307808 2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46 0.0038 1308680 3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:125 0.1458 17232656 4. PHPUnit_TextUI_Command->createRunner() /usr/share/php/PHPUnit/TextUI/Command.php:136 0.1473 17537008 5. PHPUnit_TextUI_TestRunner->__construct() /usr/share/php/PHPUnit/TextUI/Command.php:213 0.1481 17701096 6. PHP_CodeCoverage->__construct() /usr/share/php/PHPUnit/TextUI/TestRunner.php:91 0.1487 17785944 7. PHP_CodeCoverage->prefillBlacklist() /usr/share/php/PHP/CodeCoverage.php:129 0.1534 17864672 8. PHP_CodeCoverage_Filter->addFilesToBlacklist() /usr/share/php/PHP/CodeCoverage.php:555

tombevers avatar Sep 05 '11 15:09 tombevers

I forgot to release Text_Template 1.1.1RC1. Please update to that and the problem should be gone.

sebastianbergmann avatar Sep 05 '11 15:09 sebastianbergmann

Hello,

Even if I update, the problem persists :

with

  • PHPUnit 3.6.0 RC2
  • Text_Template 1.1.1RC1
  • PHP_CodeCoverage 1.1.0RC5

I've got the following message :

PHP Warning: Missing argument 1 for text_template_autoload(), called in /usr/share/php/PHP/CodeCoverage/Filter.php on line 96 and defined in /usr/share/php/Text/Template/Autoload.php on line 46

PHP Notice: Undefined variable: class in /usr/share/php/Text/Template/Autoload.php on line 58

PHP Catchable fatal error: Argument 1 passed to PHP_CodeCoverage_Filter::addFilesToBlacklist() must be an array, null given, called in /usr/share/php/PHP/CodeCoverage/Filter.php on line 96 and defined in /usr/share/php/PHP/CodeCoverage/Filter.php on line 151

Thank's you :-)

Halleck45 avatar Sep 24 '11 12:09 Halleck45

PHPUnit 3.6.0RC3 still doesn't require Text_Template 1.1.1RC1

shupp avatar Sep 27 '11 18:09 shupp

Just attempted a fresh install, getting a similar issue.

$ phpunit test/
PHP Warning:  Missing argument 1 for text_template_autoload(), called in /usr/local/share/pear/PHP/CodeCoverage/Filter.php on line 96 and defined in /usr/lib/php/pear/Text/Template/Autoload.php on line 46
PHP Stack trace:
PHP   1. {main}() /usr/local/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/local/bin/phpunit:44
PHP   3. PHPUnit_TextUI_Command->run() /usr/local/share/pear/PHPUnit/TextUI/Command.php:125
PHP   4. PHPUnit_TextUI_Command->createRunner() /usr/local/share/pear/PHPUnit/TextUI/Command.php:136
PHP   5. PHPUnit_TextUI_TestRunner->__construct() /usr/local/share/pear/PHPUnit/TextUI/Command.php:219
PHP   6. PHP_CodeCoverage_Filter->__construct() /usr/local/share/pear/PHPUnit/TextUI/TestRunner.php:93
PHP   7. text_template_autoload() /usr/local/share/pear/PHP/CodeCoverage/Filter.php:96
PHP Notice:  Undefined variable: class in /usr/lib/php/pear/Text/Template/Autoload.php on line 58
PHP Stack trace:
PHP   1. {main}() /usr/local/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/local/bin/phpunit:44
PHP   3. PHPUnit_TextUI_Command->run() /usr/local/share/pear/PHPUnit/TextUI/Command.php:125
PHP   4. PHPUnit_TextUI_Command->createRunner() /usr/local/share/pear/PHPUnit/TextUI/Command.php:136
PHP   5. PHPUnit_TextUI_TestRunner->__construct() /usr/local/share/pear/PHPUnit/TextUI/Command.php:219
PHP   6. PHP_CodeCoverage_Filter->__construct() /usr/local/share/pear/PHPUnit/TextUI/TestRunner.php:93
PHP   7. text_template_autoload() /usr/local/share/pear/PHP/CodeCoverage/Filter.php:96
PHP Catchable fatal error:  Argument 1 passed to PHP_CodeCoverage_Filter::addFilesToBlacklist() must be an array, null given, called in /usr/local/share/pear/PHP/CodeCoverage/Filter.php on line 96 and defined in /usr/local/share/pear/PHP/CodeCoverage/Filter.php on line 151
PHP Stack trace:
PHP   1. {main}() /usr/local/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/local/bin/phpunit:44
PHP   3. PHPUnit_TextUI_Command->run() /usr/local/share/pear/PHPUnit/TextUI/Command.php:125
PHP   4. PHPUnit_TextUI_Command->createRunner() /usr/local/share/pear/PHPUnit/TextUI/Command.php:136
PHP   5. PHPUnit_TextUI_TestRunner->__construct() /usr/local/share/pear/PHPUnit/TextUI/Command.php:219
PHP   6. PHP_CodeCoverage_Filter->__construct() /usr/local/share/pear/PHPUnit/TextUI/TestRunner.php:93
PHP   7. PHP_CodeCoverage_Filter->addFilesToBlacklist() /usr/local/share/pear/PHP/CodeCoverage/Filter.php:96

Installed packages, channel pear.phpunit.de:

Package Version State DbUnit 1.0.3 stable File_Iterator 1.3.0 stable PHPUnit 3.6.4 stable PHPUnit_MockObject 1.1.0 stable PHPUnit_Selenium 1.1.2 stable PHPUnit_Story 1.0.0 stable PHP_CodeBrowser 1.0.1 stable PHP_CodeCoverage 1.1.1 stable PHP_Timer 1.0.2 stable PHP_TokenStream 1.1.1 stable Text_Template 1.1.1 stable phpcpd 1.3.2 stable

Installed packages, channel pear.php.net:

Package Version State Archive_Tar 1.3.7 stable Auth_SASL 1.0.6 stable Cache_Lite 1.7.12 stable Console_Color 1.0.3 stable Console_CommandLine 1.1.3 stable Console_Getargs 1.3.5 stable Console_Getopt 1.3.0 stable Console_Table 1.1.4 stable DB 1.7.14 stable Event_Dispatcher 1.1.0 stable File_Find 1.3.1 stable HTML_Common 1.2.5 stable HTML_Table 1.8.3 stable Log 1.12.7 stable MDB2 2.4.1 stable Mail 1.2.0 stable Net_SMTP 1.6.1 stable Net_Socket 1.0.10 stable PEAR 1.9.4 stable PHP_CodeSniffer 1.3.0 stable PHP_Compat 1.5.0 stable PHP_CompatInfo 1.9.0 stable PhpDocumentor 1.4.3 stable Structures_Graph 1.0.4 stable Var_Dump 1.0.4 stable XML_Beautifier 1.2.2 stable XML_Parser 1.3.4 stable XML_Util 1.2.1 stable

stephenyeargin avatar Dec 08 '11 21:12 stephenyeargin

We are running PHPUnit 3.6.4, and do not have this issue anymore. I don't know when it was fixed. FYI, we install it via PEAR with the -o flag (install only required dependencies), and we have the auto_discover option set to 1, per the PHPUnit README. Further, we also install dbUnit and PHPUnit_Selenium packages, so one of those might be providing the dependency, I didn't check.

Cheers,

Bill

shupp avatar Dec 08 '11 22:12 shupp

@shupp Uninstalled down to bare-bones PEAR and restarted the installation process for PHPUnit to fix it as well. Thanks for the tip!

stephenyeargin avatar Dec 08 '11 23:12 stephenyeargin