This repository has been archived by the owner. It is now read-only.

include(PHPUnit_Extensions_Story_TestCase.php): failed to open stream: No such file or directory #10

Closed
ThePeach opened this Issue Mar 17, 2014 · 5 comments

Comments

Projects
None yet
3 participants
@ThePeach

ThePeach commented Mar 17, 2014

I've recently updated PHPUnit from 3.6 and alongside there came a bit of brand new dependencies.

I've recently started hitting a big problem which is impacting my tests.
I'm using latest stable version of Yii Framework (1.1.14) and latest stable version of PHPUnit (Currently 4.0.7, although I've had this problem with 3.7 as well).

Running the tests normally is totally fine:

$ phpunit --config=phpunit.xml  unit
PHPUnit 4.0.7 by Sebastian Bergmann.

Configuration read from /mnt/workspace/website/protected/tests/phpunit.xml

...............

Time: 14 ms, Memory: 9.25Mb

OK (15 tests, 1 assertion)

but when trying to generate the Clover code coverage report, I get the following error:

$ phpunit --config=phpunit.xml --coverage-clover=../../coverage.xml unit                                                                                                         
PHPUnit 4.0.7 by Sebastian Bergmann.

Configuration read from /mnt/workspace/website/protected/tests/phpunit.xml

PHP Fatal error:  Uncaught exception 'PHPUnit_Framework_Error_Warning' with message 'include(PHPUnit_Extensions_Story_TestCase.php): failed to open stream: No such file or directory' in /mnt/
workspace/yii-1.1.14.f0fee9/framework/YiiBase.php:427
Stack trace:
#0 /mnt/workspace/yii-1.1.14.f0fee9/framework/YiiBase.php(427): PHPUnit_Util_ErrorHandler::handleError(2, 'include(PHPUnit...', '/mnt/workspace/...', 427, Array)
#1 /mnt/workspace/yii-1.1.14.f0fee9/framework/YiiBase.php(427): YiiBase::autoload()
#2 [internal function]: YiiBase::autoload('PHPUnit_Extensi...')
#3 [internal function]: spl_autoload_call('PHPUnit_Extensi...')
#4 phar:///usr/bin/phpunit/php-code-coverage/CodeCoverage/Filter.php(331): class_exists('PHPUnit_Extensi...')
#5 phar:///usr/bin/phpunit/php-code-coverage/CodeCoverage/Filter.php(312): PHP_CodeCoverage_Filter->addDirectoryContainingClassToBlacklist('PHPUnit_Extensi...', 2)
#6 phar:///usr/bin/phpunit/php-code-coverage/CodeCoverage/Filter.php(257): PHP_CodeCoverage_Filter->prefillBlacklist()
#7 phar:///usr/bi in /mnt/workspace/yii-1.1.14.f0fee9/framework/YiiBase.php on line 427

Fatal error: Uncaught exception 'PHPUnit_Framework_Error_Warning' with message 'include(PHPUnit_Extensions_Story_TestCase.php): failed to open stream: No such file or directory' in /mnt/works
pace/yii-1.1.14.f0fee9/framework/YiiBase.php on line 427

PHPUnit_Framework_Error_Warning: include(PHPUnit_Extensions_Story_TestCase.php): failed to open stream: No such file or directory in /mnt/workspace/yii-1.1.14.f0fee9/framework/YiiBase.php on 
line 427

Call Stack:
    0.0006     766568   1. {main}() /usr/bin/phpunit:0
    0.0130    1359368   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:581
    0.0130    1359984   3. PHPUnit_TextUI_Command->run() phar:///usr/bin/phpunit/phpunit/TextUI/Command.php:132
    0.1026    8291984   4. PHPUnit_TextUI_TestRunner->doRun() phar:///usr/bin/phpunit/phpunit/TextUI/Command.php:179
    0.1072    9182488   5. PHPUnit_Framework_TestSuite->run() phar:///usr/bin/phpunit/phpunit/TextUI/TestRunner.php:419
    0.1078    9201304   6. PHPUnit_Framework_TestSuite->run() phar:///usr/bin/phpunit/phpunit/Framework/TestSuite.php:722
    0.1079    9201960   7. PHPUnit_Framework_TestCase->run() phar:///usr/bin/phpunit/phpunit/Framework/TestSuite.php:722
    0.1080    9201960   8. PHPUnit_Framework_TestResult->run() phar:///usr/bin/phpunit/phpunit/Framework/TestCase.php:764
    0.1317    9441400   9. PHP_CodeCoverage->stop() phar:///usr/bin/phpunit/phpunit/Framework/TestResult.php:734
    0.1807   10972808  10. PHP_CodeCoverage->append() phar:///usr/bin/phpunit/php-code-coverage/CodeCoverage.php:293
    0.1807   10980800  11. PHP_CodeCoverage->applyListsFilter() phar:///usr/bin/phpunit/php-code-coverage/CodeCoverage.php:320
    0.1807   10992008  12. PHP_CodeCoverage_Filter->isFiltered() phar:///usr/bin/phpunit/php-code-coverage/CodeCoverage.php:551
    0.1811   10992056  13. PHP_CodeCoverage_Filter->prefillBlacklist() phar:///usr/bin/phpunit/php-code-coverage/CodeCoverage/Filter.php:257
    0.4889   12023112  14. PHP_CodeCoverage_Filter->addDirectoryContainingClassToBlacklist() phar:///usr/bin/phpunit/php-code-coverage/CodeCoverage/Filter.php:312
    0.4889   12023160  15. class_exists() phar:///usr/bin/phpunit/php-code-coverage/CodeCoverage/Filter.php:331
    0.4889   12023528  16. YiiBase::autoload() phar:///usr/bin/phpunit/php-code-coverage/CodeCoverage/Filter.php:0
    0.4911   12025656  17. PHPUnit_Util_ErrorHandler::handleError() phar:///usr/bin/phpunit/php-code-coverage/CodeCoverage/Filter.php:427

My current pear installation is the following:

$ pear list -a                                                                                                                                                          [27/1969]
INSTALLED PACKAGES, CHANNEL __URI:
==================================
(no packages installed)

INSTALLED PACKAGES, CHANNEL COMPONENTS.EZ.NO:
=============================================
PACKAGE      VERSION STATE
Base         1.8     stable
ConsoleTools 1.6.1   stable

INSTALLED PACKAGES, CHANNEL DOC.PHP.NET:
========================================
(no packages installed)

INSTALLED PACKAGES, CHANNEL PEAR.AGAVI.ORG:
===========================================
(no packages installed)

INSTALLED PACKAGES, CHANNEL PEAR.PHING.INFO:
============================================
(no packages installed)

INSTALLED PACKAGES, CHANNEL PEAR.PHP-BAUSTELLE.DE:
==================================================
(no packages installed)

INSTALLED PACKAGES, CHANNEL PEAR.PHP.NET:
=========================================
PACKAGE          VERSION STATE
Archive_Tar      1.3.11  stable
Cache_Lite       1.7.15  stable
Console_Getopt   1.3.1   stable
HTTP_Request2    2.2.1   stable
Net_URL2         2.0.5   stable
PEAR             1.9.4   stable
Structures_Graph 1.0.4   stable
XML_RPC2         1.1.1   stable
XML_Util         1.2.1   stable

INSTALLED PACKAGES, CHANNEL PEAR.PHPONTRAX.COM:
===============================================
(no packages installed)

INSTALLED PACKAGES, CHANNEL PEAR.PHPUNIT.DE:
============================================
PACKAGE                           VERSION STATE
DbUnit                            1.3.0   stable
File_Iterator                     1.3.4   stable
PHPUnit                           4.0.7   stable
PHPUnit_Selenium                  1.3.3   stable
PHPUnit_SkeletonGenerator         1.2.1   stable
PHPUnit_Story                     1.0.2   stable
PHPUnit_TicketListener_Fogbugz    1.0.0   stable
PHPUnit_TicketListener_GitHub     1.0.0   stable
PHPUnit_TicketListener_GoogleCode 1.0.0   stable
PHPUnit_TicketListener_Trac       1.0.0   stable
PHP_CodeCoverage                  1.2.16  stable
PHP_Invoker                       1.1.3   stable
PHP_Timer                         1.0.5   stable
PHP_TokenStream                   1.2.2   stable
Text_Template                     1.2.0   stable

INSTALLED PACKAGES, CHANNEL PEAR.PROPELORM.ORG:
===============================================
(no packages installed)

INSTALLED PACKAGES, CHANNEL PEAR.SYMFONY.COM:
=============================================
PACKAGE VERSION STATE
Yaml    2.4.2   stable

INSTALLED PACKAGES, CHANNEL PECL.PHP.NET:
=========================================
(no packages installed)

Hoping this makes sense to you, I'm open to any suggestion as I'm a bit at loss here.

@t1gor

This comment has been minimized.

Show comment
Hide comment
@t1gor

t1gor Jan 5, 2015

I had similar issues. Upgrading from the PEAR package tool me some time. I had to add

{
"phpunit/phpunit-story": "*",
"ocramius/instantiator": "*"
}

except for the phpunit itself.

t1gor commented Jan 5, 2015

I had similar issues. Upgrading from the PEAR package tool me some time. I had to add

{
"phpunit/phpunit-story": "*",
"ocramius/instantiator": "*"
}

except for the phpunit itself.

@ThePeach

This comment has been minimized.

Show comment
Hide comment
@ThePeach

ThePeach Jan 5, 2015

Completely forgot about this issue @t1gor . I moved away from PEAR package since then and never had to look back fortunately.

I'd close the ticket, but it really should be marked as wontfix.

ThePeach commented Jan 5, 2015

Completely forgot about this issue @t1gor . I moved away from PEAR package since then and never had to look back fortunately.

I'd close the ticket, but it really should be marked as wontfix.

@ThePeach ThePeach closed this Jan 5, 2015

@t1gor

This comment has been minimized.

Show comment
Hide comment
@t1gor

t1gor Jan 6, 2015

@ThePeach, ok, but this is still strange to me... why aren't the packages included into the phpUnit composer package? there is also no documentation for that, so I had to look for those libs myself. That's just strange.

t1gor commented Jan 6, 2015

@ThePeach, ok, but this is still strange to me... why aren't the packages included into the phpUnit composer package? there is also no documentation for that, so I had to look for those libs myself. That's just strange.

@sebastianbergmann

This comment has been minimized.

Show comment
Hide comment
@sebastianbergmann

sebastianbergmann Jan 6, 2015

Contributor

Because phpunit-story is deprecated, no longer maintained, and discouraged to use. And has been for years.

Contributor

sebastianbergmann commented Jan 6, 2015

Because phpunit-story is deprecated, no longer maintained, and discouraged to use. And has been for years.

@t1gor

This comment has been minimized.

Show comment
Hide comment
@t1gor

t1gor commented Jan 6, 2015

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