Arif
Arif

Reputation: 966

Yii Unit testing

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 and PHPUnit

Then I ran this command :

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

But it is not working . I got this error:

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

Warning: include(): Failed opening 'PHPUnit_Extensions_SeleniumTestCase_Driver.php' 
for inclusion (include_path='.;
    F:\xampp\htdocs\yii\app\protected\modules\user\components;
    F:\xampp\htdocs\yii\app\protected\modules\user\models;
    F:\xampp\htdocs\yii\app\protected\components;
    F:\xampp\htdocs\yii\app\protected\models;
    F:\xampp\php\PEAR') 
in F:\xampp\htdocs\yii\framework\YiiBase.php on line 418

Fatal error: Class 'PHPUnit_Extensions_SeleniumTestCase_Driver' not found in 
    F:\xampp\php\PEAR\PHPUnit\Extensions\SeleniumTestCase.php on line 602

Does anyone know how to fix this problem?

Upvotes: 1

Views: 1200

Answers (2)

physicalattraction
physicalattraction

Reputation: 6858

Or use Composer. Example of composer.json file:

{
    "require-dev":{
        "phpunit/phpunit":">=4.5",
        "phpunit/phpunit-selenium":">=1.2",
        "phpunit/dbunit":">=1.2"
    },
    "config":{
        "bin-dir":"bin/"
    }
}

Upvotes: 0

subdee
subdee

Reputation: 136

You have to install the PHPUnit Selenium libraries manually with PEAR:

pear install phpunit/PHPUnit_Selenium

Upvotes: 3

Related Questions