PHPUnit & Selenium

Hi everybody

i am making a Unit test…

when i call this command "java -jar selenium-server.jar" to run selenium server the result would be as this:

1721

selenium.png

idon’t khow if it runs correctly or not?

after taht i opened a new CMD and called " cd protected/tests/" and " phpunit functional/SiteTest.php" but it showed an error:

‘phpunit’ is not recognized as an internal or external command

is the problem with phpunit or somewhere else????


java -jar selenium-server.jar

this command just started a selenium server.

next you need to run your functional tests


phpunit ./functional/

http://www.yiiframework.com/doc/guide/1.1/en/test.functional

after taht i runned the selenium server(as you saw in the first post) opened a new CMD and called " cd protected/tests/" and " phpunit functional/SiteTest.php" but it showed an error:

‘phpunit’ is not recognized as an internal or external command

is the problem with phpunit or somewhere else????

You have to add the path to the phpunit batch scripts to your PATH environment.

But to test if selenium works you could call phpunit with full path like




> cd protected\tests

> C:\path\to\phpunit\phpunit functional\SiteTest.php



thanks for all answers …

i think phpunit doesn’t work correctly

i call this command “pear channel-discover pear.phpunit.de” and it’s work successfully.

then i call this "pear install phpunit/PHPUnit" and the result would be as this:

1732

installerror.png

why the install is failed?

Follow these steps by using Pear :



pear upgrade

pear update-channels


pear channel-discover pear.symfony-project.com

pear install symfony/pake

pear install symfony/symfony

pear install symfony/YAML

pear install symfony/EventDispatcher


pear channel-discover components.ez.no

pear install -a ezc/eZComponents


pear install phpunit/PHPUnit

it may takes a few minutes to downloadand it’s upon ur internet bandwidth.

If u have problem with the latest command run this :


pear install --force --alldeps phpunit/PHPUnit

That’s all