Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00%
0 / 1
0.00%
0 / 4
CRAP
0.00%
0 / 23
Cest
0.00%
0 / 1
0.00%
0 / 4
110
0.00%
0 / 23
 beforeTest(\Codeception\Event\Test $e)
0.00%
0 / 1
12
0.00%
0 / 5
 afterTest(\Codeception\Event\Test $e)
0.00%
0 / 1
12
0.00%
0 / 5
 failedTest(\Codeception\Event\Fail $e)
0.00%
0 / 1
12
0.00%
0 / 5
 getSubscribedEvents()
0.00%
0 / 1
2
0.00%
0 / 8
<?php
namespace Codeception\Subscriber;
use \Symfony\Component\EventDispatcher\EventSubscriberInterface;
class Cest implements EventSubscriberInterface
{
public function beforeTest(\Codeception\Event\Test $e) {
if (!($e->getTest() instanceof \Codeception\TestCase\Cest)) return;
$test = $e->getTest();
if (method_exists($test->getTestClass(), '_before')) $test->getTestClass()->_before($e);
}
public function afterTest(\Codeception\Event\Test $e) {
if (!($e->getTest() instanceof \Codeception\TestCase\Cest)) return;
$test = $e->getTest();
if (method_exists($test->getTestClass(), '_after')) $test->getTestClass()->_after($e);
}
public function failedTest(\Codeception\Event\Fail $e) {
if (!($e->getTest() instanceof \Codeception\TestCase\Cest)) return;
$test = $e->getTest();
if (method_exists($test->getTestClass(), '_failed')) $test->getTestClass()->_failed($e);
}
static function getSubscribedEvents()
{
return array(
'test.before' => 'beforeTest',
'test.after' => 'afterTest',
'test.fail' => 'failedTest'
);
}
}