Всем привет.
Мучаюсь уже несколько дней с установкой своего TestListener для тестов.
Система такая: Selenium RC + PHP + PHPUnit
Создал 3 файла:
1) общий файл (run.php) объединяющий пользовательский слушатель и тесты:
<?php
require_once 'PHPUnit/Framework.php';
require_once 'test.php';
require_once 'SimpleTestListener.php';
$suite = new PHPUnit_Framework_TestSuite('ArrayTest');
$result = new PHPUnit_Framework_TestResult;
$result->addListener(new SimpleTestListener);
$suite->run($result);
?>
2) тесты (test.php)
<?php
require_once 'PHPUnit/Framework.php';
require_once 'Testing/Selenium.php';
class GoogleTest extends PHPUnit_Framework_TestCase
{
private $selenium;
private $test;
public function setUp()
{
$this->selenium = new Testing_Selenium("*chrome", "http://www.google.ru");
$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/", $this->selenium->getTitle());
}
}
?>
В cmd пишу: "phpunit run.php"
В ответ phpunit выдает тчо то типа:
Class GoogleTest could not be found in test3.php.
В чем косяк? Если класс теста прописать сразу в test.php то ругается на сессию