How Does One Produce a Selenium Test with Database Fixture
Zend Test appears to rely upon Zend_Test_PHPUnit_DatabaseTestCase and Selenium appears to need PHPUnit_Extensions_SeleniumTestCase yet as far as I can tell PHP doesn开发者_StackOverflow't support multiple inheritance.
You do not have to extend the PHPUnit_Extensions_SeleniumTestCase
, you can initialize Selenium in your setUp
method and close it in tearDown
:
class GoogleTest extends Zend_Test_PHPUnit_DatabaseTestCase {
private $selenium;
public function setUp()
{
$this->selenium = new Testing_Selenium("*iexplore", "http://<your_url_under_the_test>");
$this->selenium->start();
}
public function tearDown()
{
$this->selenium->stop();
}
// Your tests...
}
精彩评论