Latest PHPUnit-3.6.10 and Selenium server issue

If you are recentaly updated your PHPUnit to PHPUnit-3.6.10, you may face a issue with selenium functional testing using selenium server, because of unavailability of PHPUnit selenium package.

Errors will look like following:-

C:\xampp\htdocs\witt\protected\tests>phpunit functional/SiteTest.php

Warning: include(PHPUnit_Extensions_SeleniumTestCase_Driver.php): failed to open stream: No such file or directory in C:\xampp\htdocs\yii\framework\YiiBase.php on line 418

Warning: include(): Failed opening ‘PHPUnit_Extensions_SeleniumTestCase_Driver.php’ for inclusion (include_path=’.;C:\xampp\htdocs\witt\protected\components;C:\xampp\htdocs\witt\protected\models;C:\xampp\php\PEAR’) in C:\xampp\htdocs\yii\framework\YiiBase.php on line 418

Fatal error: Class ‘PHPUnit_Extensions_SeleniumTestCase_Driver’ not found in C:\xampp\php\PEAR\PHPUnit\Extensions\SeleniumTestCase.php on line 602

To resolve above issue you have to install PHPUnit_Selenium package manually after this it will be solved.

Steps to install all:-

  1. cd c:\xampp\php

  2. C:\xampp\php>pear upgrade pear

  3. C:\xampp\php>pear install --alldeps phpunit/PHPUnit

  4. C:\xampp\php>PEAR install phpunit/DbUnit

  5. Open "php.in" (C:\xampp\php) and uncomment "extension=php_curl.dll"

  6. C:\xampp\php>pear install phpunit/PHPUnit_Selenium

you have done all now test your application without any issue:-

1.%root of selenium server%> java -jar selenium-server-standalone-2.20.0.jar

  1. %root of test folder in yii application%>phpunit functional/SiteTest.php

hi

tanks for usefull post.

I’m done step by step instructions.and I have added all the necessary path in my windows enviroment variables and my php.ini file.by following instruction:

On Windows 7 it will be: 1) My Computer -> Right click -> Properties 2) Advanced System Settings 3) Click “Environment variables” button 4) Find “Path” entry in “System variable” section and: a) add to the end “;C:\PHP” (without quotes) or B) add to the front “C:\PHP;”

but when I going to execute following command,I got following error:

:-[

I’m pass this error with copy the phpunit.bat in(C:\xampp\php) to system32 folder( C:\Windows\System32 ) and it work. ;D

tip for install pear:

if some of problem accure during install.for install again is beter to delete pear folder in following path :

C:\Users\UserName\AppData\Local\Temp\

you can following step too:

  1. cd c:\xampp\php

  2. C:\xampp\php>pear upgrade

  3. C:\xampp\php>pear update-channels

  4. C:\xampp\php>pear channel-discover pear.symfony-project.com

  5. C:\xampp\php>pear install symfony/pake

  6. C:\xampp\php>pear install symfony/symfony

  7. C:\xampp\php>pear install symfony/YAML

  8. C:\xampp\php>pear install symfony/EventDispatcher

  9. C:\xampp\php>pear channel-discover components.ez.no

  10. C:\xampp\php>pear install -a ezc/eZComponents

  11. C:\xampp\php>pear install phpunit/PHPUnit

12.C:\xampp\php>PEAR install phpunit/DbUnit

13.Open "php.in" (C:\xampp\php) and uncomment "extension=php_curl.dll"

  1. C:\xampp\php>pear install phpunit/PHPUnit_Selenium

About selenium did not work.But the book’s instructions for continued testing by selenium does not matter and phpunit test is sufficient to continue.

Thanks a lot! No idea how I was ever going to find this out by myself.