How Does One Produce a Selenium Test with Database Fixture
Pergunta
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't support multiple inheritance.
Solução
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...
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow