3
我想使用setUpBeforeClass()来建立一个数据库连接,并做一些日志记录,但它没有被调用之前我的测试执行(或根本就没有)。 我有以下几点:PHPUnit和Selenium:setUpBeforeClass()不叫
class TestSetup extends PHPUnit_Extensions_SeleniumTestCase {
public static function setUpBeforeClass() {
//do some setup stuff here for all my tests
}
protected function setUp() {
$this->setBrowserUrl('http://' . $this->deviceIp);
}
protected function testOne() {
//do a test here
}
protected function testTwo() {
//do a test here
}
}
我做了一些挖成的PHPUnit /框架/ TestSuite.php,并已证实,线660 $这个 - >测试用例是布尔(假)。但我无法弄清楚它应该是真的还是应该发生的地方(除了在__construct()中)。
我略微超过了我的头,所以任何帮助将不胜感激。
让我知道我是否可以提供任何其他有用的信息。
Josh
谢谢你,双重的。首先,为了确认我没有错过什么:)。其次,一个非常聪明的解决方案,完全符合我的需求。 – 2011-03-16 21:29:11
这是错误:https://github.com/sebastianbergmann/phpunit-selenium/issues/69 – 2012-05-11 18:14:44