Same problem here , it’s passing all tests in this example but i’ curious why i get this PHP Warnings. i’m using CentOS 6.2 with php 5.3.3, with newest version of phpunit and selenium + yii 1.1.10
trying to pass through first test example in Yii Agile book
after i enter:# phpunit functional/SiteTest.php
PHPUnit 3.6.10 by Sebastian Bergmann.
Configuration read from /var/www/html/bg/demo/protected/tests/phpunit.xml
PHP Warning: include(SiteTest: firefox.php): failed to open stream: No such file or directory in /var/www/html/bg/yii/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:46
PHP 3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:130
PHP 4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/pear/PHPUnit/TextUI/Command.php:192
PHP 5. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/TextUI/TestRunner.php:325
PHP 6. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/Framework/TestSuite.php:705
PHP 7. method_exists() /usr/share/pear/PHPUnit/Framework/TestSuite.php:654
PHP 8. YiiBase::autoload() /usr/share/pear/PHPUnit/Framework/TestSuite.php:0
PHP Warning: include(): Failed opening 'SiteTest: firefox.php' for inclusion (include_path='.:/var/www/html/bg/demo/protected/components:/var/www/html/bg/demo/protected/models:/usr/share/pear:/usr/share/php') in /var/www/html/bg/yii/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:46
PHP 3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:130
PHP 4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/pear/PHPUnit/TextUI/Command.php:192
PHP 5. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/TextUI/TestRunner.php:325
PHP 6. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/Framework/TestSuite.php:705
PHP 7. method_exists() /usr/share/pear/PHPUnit/Framework/TestSuite.php:654
PHP 8. YiiBase::autoload() /usr/share/pear/PHPUnit/Framework/TestSuite.php:0
...PHP Warning: include(SiteTest: firefox.php): failed to open stream: No such file or directory in /var/www/html/bg/yii/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:46
PHP 3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:130
PHP 4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/pear/PHPUnit/TextUI/Command.php:192
PHP 5. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/TextUI/TestRunner.php:325
PHP 6. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/Framework/TestSuite.php:705
PHP 7. method_exists() /usr/share/pear/PHPUnit/Framework/TestSuite.php:752
PHP 8. YiiBase::autoload() /usr/share/pear/PHPUnit/Framework/TestSuite.php:0
PHP Warning: include(): Failed opening 'SiteTest: firefox.php' for inclusion (include_path='.:/var/www/html/bg/demo/protected/components:/var/www/html/bg/demo/protected/models:/usr/share/pear:/usr/share/php') in /var/www/html/bg/yii/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:46
PHP 3. PHPUnit_TextUI_Command->run() /usr/share/pear/PHPUnit/TextUI/Command.php:130
PHP 4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/pear/PHPUnit/TextUI/Command.php:192
PHP 5. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/TextUI/TestRunner.php:325
PHP 6. PHPUnit_Framework_TestSuite->run() /usr/share/pear/PHPUnit/Framework/TestSuite.php:705
PHP 7. method_exists() /usr/share/pear/PHPUnit/Framework/TestSuite.php:752
PHP 8. YiiBase::autoload() /usr/share/pear/PHPUnit/Framework/TestSuite.php:0
Time: 26 seconds, Memory: 5.50Mb
OK (3 tests, 12 assertions)
I’m also doing the exercise in the book, but my setup is slight different I’m using Netbeans 7.1.1 IDE, PHPUnit 3.6.10, Yii Framework 1.1.10, Wamp 2.2, PHP 5.3.8, and Windows 8… Netbeans returns: all OK, but skipped some tests. (Actually it skipped all tests 3 / 3)…
Netbeans returns this for me:
PHPUnit 3.6.10 by Sebastian Bergmann.
Configuration read from C:\wamp\www\aapelikoti\protected\tests\phpunit.xml
Warning: include(SiteTest: Firefox.php): failed to open stream: No such file or directory in C:\wamp\yii\framework\YiiBase.php on line 418
Call Stack:
0.0002 632504 1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
0.0073 1226776 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
0.0074 1227464 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
0.1717 7850368 4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
0.1778 8478984 5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
0.1779 8482360 6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
0.1784 8483736 7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
0.1785 8484960 8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:654
0.1786 8485312 9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0
Warning: include(): Failed opening 'SiteTest: Firefox.php' for inclusion (include_path='.;C:\wamp\www\aapelikoti\protected\components;C:\wamp\www\aapelikoti\protected\models;C:\wamp\bin\php\php5.3.8\pear') in C:\wamp\yii\framework\YiiBase.php on line 418
Call Stack:
0.0002 632504 1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
0.0073 1226776 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
0.0074 1227464 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
0.1717 7850368 4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
0.1778 8478984 5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
0.1779 8482360 6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
0.1784 8483736 7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
0.1785 8484960 8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:654
0.1786 8485312 9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0
SSPHP Warning: include(SiteTest: Firefox.php): failed to open stream: No such file or directory in C:\wamp\yii\framework\YiiBase.php on line 418
PHP Stack trace:
PHP 1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
PHP 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
PHP 4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
PHP 5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
PHP 6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP 7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP 8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:654
PHP 9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0
PHP Warning: include(): Failed opening 'SiteTest: Firefox.php' for inclusion (include_path='.;C:\wamp\www\aapelikoti\protected\components;C:\wamp\www\aapelikoti\protected\models;C:\wamp\bin\php\php5.3.8\pear') in C:\wamp\yii\framework\YiiBase.php on line 418
PHP Stack trace:
PHP 1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
PHP 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
PHP 4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
PHP 5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
PHP 6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP 7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP 8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:654
PHP 9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0
PHP Warning: include(SiteTest: Firefox.php): failed to open stream: No such file or directory in C:\wamp\yii\framework\YiiBase.php on line 418
PHP Stack trace:
PHP 1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
PHP 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
PHP 4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
PHP 5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
PHP 6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP 7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP 8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:752
PHP 9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0
PHP Warning: include(): Failed opening 'SiteTest: Firefox.php' for inclusion (include_path='.;C:\wamp\www\aapelikoti\protected\components;C:\wamp\www\aapelikoti\protected\models;C:\wamp\bin\php\php5.3.8\pear') in C:\wamp\yii\framework\YiiBase.php on line 418
PHP Stack trace:
PHP 1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
PHP 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
PHP 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
PHP 4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
PHP 5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
PHP 6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP 7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
PHP 8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:752
PHP 9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0
S
Warning: include(SiteTest: Firefox.php): failed to open stream: No such file or directory in C:\wamp\yii\framework\YiiBase.php on line 418
Call Stack:
0.0002 632504 1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
0.0073 1226776 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
0.0074 1227464 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
0.1717 7850368 4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
0.1778 8478984 5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
0.1779 8482360 6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
0.1784 8483736 7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
6.2150 8872336 8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:752
6.2151 8872688 9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0
Warning: include(): Failed opening 'SiteTest: Firefox.php' for inclusion (include_path='.;C:\wamp\www\aapelikoti\protected\components;C:\wamp\www\aapelikoti\protected\models;C:\wamp\bin\php\php5.3.8\pear') in C:\wamp\yii\framework\YiiBase.php on line 418
Call Stack:
0.0002 632504 1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
0.0073 1226776 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3.8\phpunit:46
0.0074 1227464 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:130
0.1717 7850368 4. PHPUnit_TextUI_TestRunner->doRun() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:192
0.1778 8478984 5. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\TextUI\TestRunner.php:325
0.1779 8482360 6. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
0.1784 8483736 7. PHPUnit_Framework_TestSuite->run() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:705
6.2150 8872336 8. method_exists() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:752
6.2151 8872688 9. YiiBase::autoload() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Framework\TestSuite.php:0
Time: 6 seconds, Memory: 8.75Mb
OK, but incomplete or skipped tests!
Tests: 3, Assertions: 0, Skipped: 3.
I solved this problem simply by uninstalling all java programs through control panel and reinstalled java SDK, then redownloaded selenium RC server moved it to Java SDK installation folder / bin and started server from cmd: java -jar selenium.jar
code was throwing error because selenium wasn’t working correctly (couldn’t start browser)
Just find the TestSuite.php file (it usually is in PEAR_DIRECTORY\PHPUnit\Framework - for my xampp server it is C:\xampp\php\PEAR\PHPUnit\Framework) and replace (for me it’s on line 653)
method_exists($this->name, 'setUpBeforeClass'))
with
@method_exists($this->name, 'setUpBeforeClass'))
P.S. Tests been working before, just gave this unneeded warning information
Update:
If you get any other errors, just find, on which line in TestSuite.php the error is (usually it is method_exists function) and just add the @ sign before - of course if it is only visual issue
Unfortunately, this did not solve the issue for me. I edited the TestSuite.php and also put some comments aroud the test to verify it is called:
echo "before test method exists\n";
if ($this->testCase &&
@method_exists($this->name, 'setUpBeforeClass')) {
call_user_func(array($this->name, 'setUpBeforeClass'));
}
echo "after test method exists\n";
And as the output shows, these statements are called but the error still shows up:
klaas@mint-desktop /var/www/websites/demo/protected/tests $ phpunit functional/SiteTest.php D
PHPUnit 3.6.10 by Sebastian Bergmann.
Configuration read from /var/www/websites/demo/protected/tests/phpunit.xml
before test method exists
after test method exists
before test method exists
after test method exists
SSSPHP Warning: include(SiteTest: Firefox.php): failed to open stream: No such file or directory in /var/www/websites/yii-1.1.10.r3566/framework/YiiBase.php on line 418
PHP Warning: include(): Failed opening 'SiteTest: Firefox.php' for inclusion (include_path='.:/var/www/websites/demo/protected/components:/var/www/websites/demo/protected/models:/usr/share/php:/usr/share/pear') in /var/www/websites/yii-1.1.10.r3566/framework/YiiBase.php on line 418
Time: 0 seconds, Memory: 5.00Mb
OK, but incomplete or skipped tests!
Tests: 3, Assertions: 0, Skipped: 3.
Furthermore, I do not get the stacktrace message and do not see how to enable them. Is this an option of the phpunit command?
And is there another soulution to get rid of the warning messages?