Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00%
0 / 1
0.00%
0 / 9
CRAP
0.00%
0 / 28
Listener
0.00%
0 / 1
0.00%
0 / 9
90
0.00%
0 / 28
 __construct(EventDispatcher $dispatcher)
0.00%
0 / 1
2
0.00%
0 / 3
 addError(\PHPUnit_Framework_Test $test, \Exception $e, $time)
0.00%
0 / 1
2
0.00%
0 / 3
 addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time)
0.00%
0 / 1
2
0.00%
0 / 3
 addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, $time)
0.00%
0 / 1
2
0.00%
0 / 3
 addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $time)
0.00%
0 / 1
2
0.00%
0 / 3
 startTestSuite(\PHPUnit_Framework_TestSuite $suite)
0.00%
0 / 1
2
0.00%
0 / 4
 endTestSuite(\PHPUnit_Framework_TestSuite $suite)
0.00%
0 / 1
2
0.00%
0 / 3
 startTest(\PHPUnit_Framework_Test $test)
0.00%
0 / 1
2
0.00%
0 / 3
 endTest(\PHPUnit_Framework_Test $test, $time)
0.00%
0 / 1
2
0.00%
0 / 3
<?php
namespace Codeception\PHPUnit;
use Symfony\Component\EventDispatcher\EventDispatcher;
class Listener implements \PHPUnit_Framework_TestListener
{
/**
* @var \Symfony\Component\EventDispatcher\EventDispatcher
*/
protected $dispatcher;
public function __construct(EventDispatcher $dispatcher) {
$this->dispatcher = $dispatcher;
}
public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) {
$this->dispatcher->dispatch('fail.error', new \Codeception\Event\Fail($test, $e));
}
public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time) {
$this->dispatcher->dispatch('fail.fail', new \Codeception\Event\Fail($test, $e));
}
public function addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) {
$this->dispatcher->dispatch('fail.incomplete', new \Codeception\Event\Fail($test, $e));
}
public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) {
$this->dispatcher->dispatch('fail.skipped', new \Codeception\Event\Fail($test, $e));
}
public function startTestSuite(\PHPUnit_Framework_TestSuite $suite)
{
$this->dispatcher->dispatch('suite.start', new \Codeception\Event\Suite($suite));
}
public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) {
$this->dispatcher->dispatch('suite.end', new \Codeception\Event\Suite($suite));
}
public function startTest(\PHPUnit_Framework_Test $test) {
$this->dispatcher->dispatch('test.start', new \Codeception\Event\Test($test));
}
public function endTest(\PHPUnit_Framework_Test $test, $time) {
$this->dispatcher->dispatch('test.end', new \Codeception\Event\Test($test));
}
}