【发布时间】:2010-09-30 22:13:15
【问题描述】:
我在 PHP 中有以下 Selenium 测试:
<?php
require_once('PHPUnit/Extensions/SeleniumTestCase.php');
class Example extends PHPUnit_Extensions_SeleniumTestCase
{
protected function setUp()
{
$this->setBrowser("*chrome");
$this->setBrowserUrl("http://change-this-to-the-site-you-are-testing/");
}
public function testMyTestCase()
{
$this->open("/frontend_dev.php");
try {
$this->assertTrue($this->isTextPresent("Local Coupons"));
} catch (PHPUnit_Framework_AssertionFailedError $e) {
array_push($this->verificationErrors, $e->toString());
}
}
}
当我尝试运行它时(通过运行“php filename.php”)我得到了错误:
PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found in /usr/share/php/PHPUnit/Extensions/SeleniumTestCase.php on line 60
这是有道理的,因为类没有在任何地方定义,但为什么不呢?我安装了 PHPUnit。 PHPUnit 中不包含一个名为 PHPUnit_Framework_TestCase 的类似乎有点奇怪。有什么想法吗?
【问题讨论】: