Permalink
Browse files

OutputHandler: added prepare() (BC break)

  • Loading branch information...
milo committed Jul 31, 2017
1 parent 64ef642 commit e0005633ce8511c89041b6b3325a952b71cc61d2
@@ -51,6 +51,11 @@ public function begin()
}
public function prepare(Test $test)
{
}
public function finish(Test $test)
{
$outputs = [
@@ -44,6 +44,11 @@ public function begin()
}
public function prepare(Test $test)
{
}
public function finish(Test $test)
{
$this->buffer .= "\t\t<testcase classname=\"" . htmlspecialchars($test->getSignature()) . '" name="' . htmlspecialchars($test->getSignature()) . '"';
@@ -39,6 +39,11 @@ public function begin()
}
public function prepare(Test $test)
{
}
public function finish(Test $test)
{
$message = ' ' . str_replace("\n", "\n ", Tester\Dumper::removeColors(trim($test->message)));
@@ -37,6 +37,11 @@ public function begin()
}
public function prepare(Test $test)
{
}
public function finish(Test $test)
{
$message = str_replace("\n", "\n# ", trim($test->message));
@@ -17,6 +17,8 @@ interface OutputHandler
{
function begin();
function prepare(Test $test);
function finish(Test $test);
function end();
@@ -208,6 +208,17 @@ public function getJobCount()
}
/**
* @return void
*/
public function prepareTest(Test $test)
{
foreach ($this->outputHandlers as $handler) {
$handler->prepare(clone $test);
}
}
/**
* Writes to output handlers.
* @return void
@@ -56,6 +56,7 @@ public function initiate($file)
foreach (is_array($res) ? $res : [$res] as $testVariety) {
/** @var Test $testVariety */
if ($testVariety->hasResult()) {
$this->runner->prepareTest($testVariety);
$this->runner->finishTest($testVariety);
} else {
$prepared[] = $testVariety;
@@ -68,6 +69,7 @@ public function initiate($file)
}
foreach ($tests as $test) {
$this->runner->prepareTest($test);
$this->runner->addJob(new Job($test, $php, $this->runner->getEnvironmentVariables()));
}
}
@@ -15,6 +15,11 @@ class Logger implements Tester\Runner\OutputHandler
public $results = [];
public function prepare(Test $test)
{
}
public function finish(Test $test)
{
$this->results[] = [basename($test->getFile()), $test->getResult(), $test->message];
@@ -15,6 +15,11 @@ class Logger implements Tester\Runner\OutputHandler
public $results = [];
public function prepare(Test $test)
{
}
public function finish(Test $test)
{
$this->results[basename($test->getFile())] = [$test->getResult(), $test->message];
@@ -15,6 +15,11 @@ class Logger implements Tester\Runner\OutputHandler
public $results = [];
public function prepare(Test $test)
{
}
public function finish(Test $test)
{
$this->results[basename($test->getFile())] = $test->getResult();
@@ -17,6 +17,11 @@ class Logger implements Tester\Runner\OutputHandler
public $results = [];
public function prepare(Test $test)
{
}
public function finish(Test $test)
{
$this->results[basename($test->getFile())] = [$test->getResult(), $test->message];
@@ -16,6 +16,11 @@ class Logger implements Tester\Runner\OutputHandler
public $results = [];
public function prepare(Test $test)
{
}
public function finish(Test $test)
{
$this->results[] = [$test->getResult(), basename($test->getFile())];

0 comments on commit e000563

Please sign in to comment.