如何在“
PHP内”运行测试而不是使用’PHPunit’命令?例:
<?PHP require_once 'PHPUnit/Extensions/SeleniumTestCase.PHP'; class MySeleniumTest extends PHPUnit_Extensions_SeleniumTestCase { protected function setUp() { $this->setBrowser("*firefox"); $this->setBrowserUrl("http://example.com/"); } public function testMyTestCase() { $this->open("/"); $this->click("//a[@href='/contact/']"); } } $test = new MySeleniumTest(); //I want to run the test and get information about the results so I can store them in the database,send an email etc. ?>
或者我是否必须将测试写入文件,通过system()/ exec()调用PHPunit并解析输出? 原文链接:https://www.f2er.com/php/137480.html