Cant get PHPUnit and selenium working correctly

Hopefully someone will be able to help me with this because I've been pulling my hair out for hours on this one...

Background:
I am reading the Agile Web Application Development Book and I'm up to the part about testing. In this book they recommend installing Selenium and PHPUnit
I have successfully installed Selenium R C
I'm running WAMP server 2.0 on Windows Vista

Problem:
I have tried to install PHPUnit 2 ways.

1. The first way was through PEAR. PEAR managed to download it and install it okay...but when I try to run phpunit I get the following error message.

'phpunit' is not recognized as an internal or external command, operable program or batch file.

As far as I can tell this means that the phpunit executable file does not exist in my PATH environment variable. Trouble is, I cant find ANY phpunit executable file. It just doesn't seem to exist...

2. So I tried another way of installing it. I downloaded directly from GITHUB and extracted the archive to my computer. This time, I had more luck, I can get phpunit running (ie: There is an executable) but when I run it on a test case I get these error messages...

The command I ran

c:\wamp\www\yii\agile\protected\tests>phpunit functional/SiteTest.php

The error message

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
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
PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Extensions/Se
leniumTestCase.php' (include_path='C:\wamp\bin\php\php5.3.0\PEAR;.;C:\wamp\bin\p
hp\php5.3.0\pear') in C:\wamp\www\yii\framework\test\CWebTestCase.php on line 11
Fatal error: require_once(): Failed opening required 'PHPUnit/Extensions/Seleniu
mTestCase.php' (include_path='C:\wamp\bin\php\php5.3.0\PEAR;.;C:\wamp\bin\php\ph
p5.3.0\pear') in C:\wamp\www\yii\framework\test\CWebTestCase.php on line 11

I have tried searching for that file (ie:SeleniumTestCase.php) on the net but can barely find any information on it. I can't find it on my HD so where do I get a copy of it?

Does anyone know how to fix this problem? I'm completely stumped and I would be so grateful if someone could help me out.

I've just been getting exactly the same error. I had removed phpunit using pear, then installed it using apt-get because I wanted an older version, then decided that version was too old, so I removed the version from the repos and installed an older version using pear. Because the selenium stuff is a dependency, but lives inside phpunit, and pear lets you uninstall phpunit without uninstalling the selenium stuff first the pear uninstall of phpunit breaks the pear installed PHPUnit_Selenium, but it remains installed. So that's the root of the problem.

The fix is to uninstall them both, then reinstall phpunit which will then reinstall selenium.

For example... (I downgraded to 3.5.6 because I want --verbose to work like it used to.)

Well Guys I'm also in same book and same chapter first I had following error :

E:\xampp\htdocs\YiiRoot\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 E:\xampp\htdocs\yii\framework\test\CWeb
TestCase.php on line 11

Warning: require_once(PHPUnit/Extensions/SeleniumTestCase.php): failed to open s
tream: No such file or directory in E:\xampp\htdocs\yii\framework\test\CWebTestC
ase.php on line 11
PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Extensions/Se
leniumTestCase.php' (include_path='.;E:\xampp\php\PEAR') in E:\xampp\htdocs\yii\
framework\test\CWebTestCase.php on line 11

and then following this forum user Tommo given some instructions to follow when did as it is I extracted the files from PHPUnit packages from pear.phpunit.de version 1.2.6 (stable) and copied to E:\xampp\php\PEAR\PHPUnit\Extensions to folder now when I execute the following line E:\xampp\htdocs\YiiRoot\protected\tests>phpunit functional/SiteTest.php

PHP Warning: include(SiteTest: Firefox.php): failed to open stream: No such fil
e or directory in E:\xampp\htdocs\yii\framework\YiiBase.php on line 338

Warning: include(SiteTest: Firefox.php): failed to open stream: No such file or
directory in E:\xampp\htdocs\yii\framework\YiiBase.php on line 338
PHP Warning: include(): Failed opening 'SiteTest: Firefox.php' for inclusion (i
nclude_path='.;E:\xampp\htdocs\YiiRoot\protected\components;E:\xampp\htdocs\YiiR
oot\protected\models;E:\xampp\php\PEAR') in E:\xampp\htdocs\yii\framework\YiiBas
e.php on line 338

Warning: include(): Failed opening 'SiteTest: Firefox.php' for inclusion (includ
e_path='.;E:\xampp\htdocs\YiiRoot\protected\components;E:\xampp\htdocs\YiiRoot\p
rotected\models;E:\xampp\php\PEAR') in E:\xampp\htdocs\yii\framework\YiiBase.php
on line 338
SSSPHP Warning: include(SiteTest: Firefox.php): failed to open stream: No such
file or directory in E:\xampp\htdocs\yii\framework\YiiBase.php on line 338

Warning: include(SiteTest: Firefox.php): failed to open stream: No such file or
directory in E:\xampp\htdocs\yii\framework\YiiBase.php on line 338
PHP Warning: include(): Failed opening 'SiteTest: Firefox.php' for inclusion (i
nclude_path='.;E:\xampp\htdocs\YiiRoot\protected\components;E:\xampp\htdocs\YiiR
oot\protected\models;E:\xampp\php\PEAR') in E:\xampp\htdocs\yii\framework\YiiBas
e.php on line 338

Well Guys I'm also in same book and same chapter first I had following error :

E:\xampp\htdocs\YiiRoot\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 E:\xampp\htdocs\yii\framework\test\CWeb
TestCase.php on line 11

Warning: require_once(PHPUnit/Extensions/SeleniumTestCase.php): failed to open s
tream: No such file or directory in E:\xampp\htdocs\yii\framework\test\CWebTestC
ase.php on line 11
PHP Fatal error: require_once(): Failed opening required 'PHPUnit/Extensions/Se
leniumTestCase.php' (include_path='.;E:\xampp\php\PEAR') in E:\xampp\htdocs\yii\
framework\test\CWebTestCase.php on line 11

and then following this forum user Tommo given some instructions to follow when did as it is I extracted the files from PHPUnit packages from pear.phpunit.de version 1.2.6 (stable) and copied to E:\xampp\php\PEAR\PHPUnit\Extensions to folder now when I execute the following line E:\xampp\htdocs\YiiRoot\protected\tests>phpunit functional/SiteTest.php

PHP Warning: include(SiteTest: Firefox.php): failed to open stream: No such fil
e or directory in E:\xampp\htdocs\yii\framework\YiiBase.php on line 338

Warning: include(SiteTest: Firefox.php): failed to open stream: No such file or
directory in E:\xampp\htdocs\yii\framework\YiiBase.php on line 338
PHP Warning: include(): Failed opening 'SiteTest: Firefox.php' for inclusion (i
nclude_path='.;E:\xampp\htdocs\YiiRoot\protected\components;E:\xampp\htdocs\YiiR
oot\protected\models;E:\xampp\php\PEAR') in E:\xampp\htdocs\yii\framework\YiiBas
e.php on line 338

Warning: include(): Failed opening 'SiteTest: Firefox.php' for inclusion (includ
e_path='.;E:\xampp\htdocs\YiiRoot\protected\components;E:\xampp\htdocs\YiiRoot\p
rotected\models;E:\xampp\php\PEAR') in E:\xampp\htdocs\yii\framework\YiiBase.php
on line 338
SSSPHP Warning: include(SiteTest: Firefox.php): failed to open stream: No such
file or directory in E:\xampp\htdocs\yii\framework\YiiBase.php on line 338

Warning: include(SiteTest: Firefox.php): failed to open stream: No such file or
directory in E:\xampp\htdocs\yii\framework\YiiBase.php on line 338
PHP Warning: include(): Failed opening 'SiteTest: Firefox.php' for inclusion (i
nclude_path='.;E:\xampp\htdocs\YiiRoot\protected\components;E:\xampp\htdocs\YiiR
oot\protected\models;E:\xampp\php\PEAR') in E:\xampp\htdocs\yii\framework\YiiBas
e.php on line 338

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

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

It's interesting that PHPUnit is working, tests are passing. But every time I see the next warnings in my console:
"Warning: include(): Failed opening 'SigupTest: Firefox.php' for inclusion (include_path=.;C:\{path_to_yii_application}\protected\components;C:\{path_to_yii_application}\protected\models;C:\usr\local\php\PEAR\pear;C:\usr\local\php\includes') in C:\{path_to_yii_application}\framework\YiiBase.php on line 418"