Я устанавливаю PHPUnit и Selenium для тестирования на PHP. Я успешно справился с PHPUnit, но с Selenium что-то не так.
Я слежу за книгой «Разработчик гибких веб-приложений с Yii 1.1 и PHP5», и у меня возникла проблема на стр. 47, глава 3. Я взял инструкцию выполнить следующую команду (я использую Win 7)
cd cd protected/tests/
phpunit functional/SiteTest.php
и вот вывод на консоль:
C:\wamp\www\demo\protected\tests>phpunit functional/SiteTest.php
PHP Warning: require_once(PHPUnit/Extensions/SeleniumTestCase.php): failed to o
pen stream: No such file or directory in C:\wamp\www\yii\framework\test\CWebTest
Case.php on line 11
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\Tex
tUI\Command.php:125
PHP 4. PHPUnit_TextUI_Command->handleArguments() C:\wamp\bin\php\php5.3.8\pear
\PHPUnit\TextUI\Command.php:134
PHP 5. PHPUnit_TextUI_Command->handleBootstrap() C:\wamp\bin\php\php5.3.8\pear
\PHPUnit\TextUI\Command.php:615
PHP 6. PHPUnit_Util_Fileloader::checkAndLoad() C:\wamp\bin\php\php5.3.8\pear\P
HPUnit\TextUI\Command.php:833
PHP 7. PHPUnit_Util_Fileloader::load() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\U
til\Fileloader.php:79
PHP 8. include_once() C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Util\Fileloader.ph
p:95
PHP 9. require_once() C:\wamp\www\demo\protected\tests\bootstrap.php:8
PHP 10. YiiBase::autoload() C:\wamp\www\demo\protected\tests\bootstrap.php:0
PHP 11. include() C:\wamp\www\yii\framework\YiiBase.php:402
Warning: require_once(PHPUnit/Extensions/SeleniumTestCase.php): failed to open s
tream: No such file or directory in C:\wamp\www\yii\framework\test\CWebTestCase.
php on line 11
Call Stack:
0.0004 326016 1. {main}() C:\wamp\bin\php\php5.3.8\phpunit:0
0.2333 731432 2. PHPUnit_TextUI_Command::main() C:\wamp\bin\php\php5.3
.8\phpunit:46
0.2334 731784 3. PHPUnit_TextUI_Command->run() C:\wamp\bin\php\php5.3.
8\pear\PHPUnit\TextUI\Command.php:125
0.2334 731784 4. PHPUnit_TextUI_Command->handleArguments() C:\wamp\bin
\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:134
0.3216 1235192 5. PHPUnit_TextUI_Command->handleBootstrap() C:\wamp\bin
\php\php5.3.8\pear\PHPUnit\TextUI\Command.php:615
0.3282 1247704 6. PHPUnit_Util_Fileloader::checkAndLoad() C:\wamp\bin\p
hp\php5.3.8\pear\PHPUnit\TextUI\Command.php:833
0.3300 1247792 7. PHPUnit_Util_Fileloader::load() C:\wamp\bin\php\php5.
3.8\pear\PHPUnit\Util\Fileloader.php:79
0.3312 1252432 8. include_once('C:\wamp\www\demo\protected\tests\bootst
rap.php') C:\wamp\bin\php\php5.3.8\pear\PHPUnit\Util\Fileloader.php:95
0.5287 1527000 9. require_once('C:\wamp\www\demo\protected\tests\WebTes
tCase.php') C:\wamp\www\demo\protected\tests\bootstrap.php:8
0.5289 1527648 10. YiiBase::autoload() C:\wamp\www\demo\protected\tests\
bootstrap.php:0
0.5471 1550384 11. include('C:\wamp\www\yii\framework\test\CWebTestCase.
php') C:\wamp\www\yii\framework\YiiBase.php:402
Я устанавливаю Selenium RC, следуйте этой статье http://geekswithblogs.net/Saqib/archive/2008/01/03/setting-up-selenium-rc-server-in-windows.aspx
1. Download latest Java SE from http://java.sun.com/ and install
2. Download latest version of Selenium RC from and extract
3. Create a folder named Selenium at C:\Program
Files\Java\jdk1.6.0_03\bin
4. Copy all files under Selenium-server-0.9.2 which you will find in
the extracted folder and paste in the newly created folder
5. From Command prompt run the following commands:
cd \
cd C:\PROGRA~1\Java\jdk1.6.0_03\bin
java -jar .\Selenium\selenium-server.jar -interactive