Phpunit is working correctly in a basic project but when I try to use in yii functional test, I get this error: PHP Fatal error: Call to undefined method PHPUnit_Framework_Warning::setupSpecificBrowser() in ~/phpunit/vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumBrowserSuite.php on line 95
I installed phpunit using composer. Version: PHPUnit 4.0.17 by Sebastian Bergmann. Selenium version: 2.41.0
I run selenium like this: java -jar selenium-server-standalone-2.41.0.jar
I run test class like this: ~/phpunit/vendor/bin/phpunit functional/SiteTest.php
In basic project code:
class WebTest extends PHPUnit_Extensions_Selenium2TestCase
{
protected function setUp()
{
$this->setBrowser('firefox');
$this->setBrowserUrl('http://www.example.com/');
}
public function testTitle()
{
$this->url('http://www.example.com/');
$this->assertEquals('Title string', $this->title());
}
}
Yii code:
class WebTestCase extends CWebTestCase
{
protected function setUp()
{
parent::setUp();
$this->setBrowserUrl(Yii::app()->params['url']['base']);
}
}
Also CWebTestCase class exteds PHPUnit_Extensions_SeleniumTestCase class, not PHPUnit_Extensions_Selenium2TestCase.