Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00%
0 / 1
0.00%
0 / 7
CRAP
0.00%
0 / 40
TestCase
0.00%
0 / 1
0.00%
0 / 7
90
0.00%
0 / 40
 getFeature()
0.00%
0 / 1
2
0.00%
0 / 4
 getFileName()
0.00%
0 / 1
2
0.00%
0 / 4
 runStep(\Codeception\Step $step)
0.00%
0 / 1
6
0.00%
0 / 13
 fire($event, Event $eventType)
0.00%
0 / 1
6
0.00%
0 / 7
 getScenario()
0.00%
0 / 1
2
0.00%
0 / 4
 getTrace()
0.00%
0 / 1
2
0.00%
0 / 4
 toString()
0.00%
0 / 1
2
0.00%
0 / 4
<?php
namespace Codeception;
use Symfony\Component\EventDispatcher\Event;
abstract class TestCase extends \PHPUnit_Framework_TestCase implements \PHPUnit_Framework_SelfDescribing
{
protected $scenario;
protected $trace = array();
public function getFeature()
{
return null;
}
public function getFileName()
{
return get_class($this) . '::' . $this->getName();
}
public function runStep(\Codeception\Step $step)
{
$this->trace[] = $step;
$this->fire('step.before', new \Codeception\Event\Step($this, $step));
try {
$result = $step->run();
} catch (\Exception $e) {
$this->fire('step.after', new \Codeception\Event\Step($this, $step));
throw $e;
}
$this->fire('step.after', new \Codeception\Event\Step($this, $step));
return $result;
}
protected function fire($event, Event $eventType)
{
$this->dispatcher->dispatch($event, $eventType);
foreach ($this->scenario->getGroups() as $group) {
$this->dispatcher->dispatch($event.'.'.$group, $eventType);
}
}
/**
* @return \Codeception\Scenario
*/
public function getScenario()
{
return $this->scenario;
}
public function getTrace()
{
return $this->trace;
}
public function toString()
{
$this->getFeature();
}
}