Functional Tests code coverage

I had previously set up Selenium and phpunit to where I was not getting any errors, but today as I was trying to get code coverage to work for my selenium (functional) tests, I ended up reinstalling phpunit_selenium and I started getting this




PHP Warning:  include(SiteTest: Firefox.php): failed to open stream: No such file or directory in /home/aasher/Projects/fructose_freedom/framework/YiiBase.php on line 418

PHP Stack trace:

PHP   1. {main}() /usr/bin/phpunit:0

PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:45

PHP   3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:130

PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:192

PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:325

PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705

PHP   7. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705

PHP   8. method_exists() /usr/share/php/PHPUnit/Framework/TestSuite.php:654

PHP   9. YiiBase::autoload() /usr/share/php/PHPUnit/Framework/TestSuite.php:0

PHP Warning:  include(): Failed opening 'SiteTest: Firefox.php' for inclusion (include_path='.:/home/aasher/Projects/fructose_freedom/htmldocs/protected/vendors:/home/aasher/Projects/fructose_freedom/htmldocs/protected/components:/home/aasher/Projects/fructose_freedom/htmldocs/protected/models:/usr/share/php:/usr/share/pear') in /home/aasher/Projects/fructose_freedom/framework/YiiBase.php on line 418

PHP Stack trace:

PHP   1. {main}() /usr/bin/phpunit:0

PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:45

PHP   3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:130

PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:192

PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:325

PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705

PHP   7. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705

PHP   8. method_exists() /usr/share/php/PHPUnit/Framework/TestSuite.php:654

PHP   9. YiiBase::autoload() /usr/share/php/PHPUnit/Framework/TestSuite.php:0

SSSPHP Warning:  include(SiteTest: Firefox.php): failed to open stream: No such file or directory in /home/aasher/Projects/fructose_freedom/framework/YiiBase.php on line 418

PHP Stack trace:

PHP   1. {main}() /usr/bin/phpunit:0

PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:45

PHP   3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:130

PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:192

PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:325

PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705

PHP   7. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705

PHP   8. method_exists() /usr/share/php/PHPUnit/Framework/TestSuite.php:752

PHP   9. YiiBase::autoload() /usr/share/php/PHPUnit/Framework/TestSuite.php:0

PHP Warning:  include(): Failed opening 'SiteTest: Firefox.php' for inclusion (include_path='.:/home/aasher/Projects/fructose_freedom/htmldocs/protected/vendors:/home/aasher/Projects/fructose_freedom/htmldocs/protected/components:/home/aasher/Projects/fructose_freedom/htmldocs/protected/models:/usr/share/php:/usr/share/pear') in /home/aasher/Projects/fructose_freedom/framework/YiiBase.php on line 418

PHP Stack trace:

PHP   1. {main}() /usr/bin/phpunit:0

PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:45

PHP   3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:130

PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:192

PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:325

PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705

PHP   7. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705

PHP   8. method_exists() /usr/share/php/PHPUnit/Framework/TestSuite.php:752

PHP   9. YiiBase::autoload() /usr/share/php/PHPUnit/Framework/TestSuite.php:0




Time: 0 seconds, Memory: 10.25Mb



so then. two questions…

why am I getting this error?

and 2: how do I get coverage to actually give me real data about code that was tested during the functional tests…

I have set up my prepend and append in my php.ini and also updated my $GLOBALS[‘PHPUNIT_COVERAGE_DATA_DIRECTORY’] = $_SERVER[‘DOCUMENT_ROOT’];

what am I missing here?

Try to update both phpunit and selenium server to recent versions!!!

I had already installed the latest versions before trying this.

the good news is, the selenium tests run, they just don’t report properly about my code coverage.

Hey!

Check out my answer here. I had exactly same problem and got rid of this senseless info in command prompt

Were you able to get code coverage to properly generate? Even with


@coverage

annotation my coverage still isn’t happening.