This I have found on the net in various places but with no actual solution. The default code for running a test is
<?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());
}
}
?>
This gives me the following error
Fatal error: Cannot redeclare class PHPUnit_Framework_TestCase in /usr/lib/php/PHPUnit/Framework/TestCase.php on line 115
My include path looks like this
.:/usr/lib/php/ZendLatest/library/:/usr/lib/php/:./PEAR/
Can anyone help me fix this? It isn't obvious where the class is being re-declared, is it on line 115 of the file mentioned above or somewhere else?
Thanks