开发者

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...

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜