Greetings. At me a problem with connection of the PHPUnit_Framework_TestListener.
I use phpUnit 3.5.12
Maximum of that has achieved, it is an inscription about the beginning of the test.
Explain how correctly to connect the given class to tests please.
Connect to PHPUnit_Framework_TestListener
Moderator: General Moderators
Re: Connect to PHPUnit_Framework_TestListener
Code: Select all
<?php
require_once 'PHPUnit/Framework.php';
include 'ArrayTest.php';
require_once 'SimpleTestListener.php';
$suite = new PHPUnit_Framework_TestSuite('ArrayTest');
$result = new PHPUnit_Framework_TestResult;
$result->addListener(new SimpleTestListener);
$suite->run($result);
?>
Code: Select all
<?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.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/", $this->selenium->getTitle());
}
}
?>
On an output:phpunit test.php
Class GoogleTest could not be found in test3.php.