How can I run a test "within PHP" instead of using the 'phpunit' command? Example:
<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
class MySeleniumTest extends PHPUnit_Extensions_SeleniumTestCase {
protected function setUp() {
$this->setBrowser("*firefox");
$this->setBrowserUrl("http://example.com/");
}
public function testMyTestCase() {
$this->open("/");
$this->click("//a[@href='/contact/']");
}
}
$test = new MySeleniumTest();
//I want to run the test and get information about the results so I can store them in the database, send an email etc.
?>
Or do I have to write the test to a file, invoke phpunit via system()/exec() and parse the output? :(