I'm having some trouble starting automated tests with Yii, PHPUnit and Selenium I've set up Selenium and PHPUnit and when i run phpunit . I get this error:
Warning: include(PHPUnit_Extensions_Story_TestCase.php): failed to open stream: No such
file or directory in path_to/framework/YiiBase.php on line 427
Warning: include(): Failed opening 'PHPUnit_Extensions_Story_TestCase.php' for inclusion
(include_path='.:') in path_to/framework/YiiBase.php on line 427
PHPUnit_Extensions_Selenium2TestCase_WebDriverException: The path to the driver executable
must be set by the phantomjs.binary.path capability/system property/PATH variable; for more
information, see https://github.com/ariya/phantomjs/wiki. The latest version can be downloaded
from http://phantomjs.org/download.html
I have Selenium RC running in background. I also have PHPunit folder inside tests folder, with Story and selenium extensions.
My code looks looks like this
define('TEST_BASE_URL','http://some_local_url/');
class WebTestCase extends PHPUnit_Extensions_Selenium2TestCase
{
/**
* Sets up before each test method runs.
* This mainly sets the base URL for the test application.
*/
protected function setUp()
{
parent::setUp();
$this->setHost('localhost');
$this->setPort(4444);
$this->setBrowserUrl(TEST_BASE_URL);
}
}
class SiteTest extends WebTestCase
{
public function testIndex()
{
$this->open('');
$this->assertTextPresent('Welcome');
}
}
index-test.php, or the entry script forsome_local_url? - topher