这是我在网上的各个地方找到的,但没有实际的解决方案。运行测试的默认代码是
<?php
set_include_path(get_include_path() . PATH_SEPARATOR . './PEAR/');
require_once 'Testing/Selenium.php';
require_once 'PHPUnit/Framework/TestCase.php';
class GoogleTest extends PHPUnit_Framework_TestCase
{
private $selenium;
public function setUp()
{
$this->selenium = new Testing_Selenium("*firefox",
"http://www.google.com");
$this->selenium->start();
}
public function tearDown()
{
$this->selenium->stop();
}
public function testGoogle()
{
$this->selenium->open("/");
$this->selenium->type("q", "hello world");
$this->selenium->click("btnG");
$this->selenium->waitForPageToLoad(10000);
$this->assertRegExp("/Google Search/", $this->selenium->getTitle());
}
}
?>
这给了我以下错误
Fatal error: Cannot redeclare class PHPUnit_Framework_TestCase in /usr/lib/php/PHPUnit/Framework/TestCase.php on line 115
我的包含路径看起来像这样
.:/usr/lib/php/ZendLatest/library/:/usr/lib/php/:./PEAR/
谁能帮我解决这个问题?重新声明类的位置并不明显,是在上述文件的第 115 行还是在其他地方?
谢谢