public function startTest(PHPUnit_Framework_Test $test) { $name = strtr('%test%::%name%', array('%test%' => get_class($test), '%name%' => $test->getName())); if ($this->coverage) { $this->coverage->start($name); } return; }
public function beforeExample(ExampleEvent $event) { $example = $event->getExample(); $name = strtr('%spec% => %example%', array('%spec%' => $example->getSpecification()->getClassReflection()->getName(), '%example%' => $example->getTitle())); if ($this->coverage) { $this->coverage->start($name); } }
function it_should_start_coverage(CodeCoverageSession $coverageSession, ExampleEvent $event, ExampleNode $example, SpecificationNode $specificationNode) { $reflection = new \ReflectionClass($this); $event->getExample()->willReturn($example); $example->getSpecification()->willReturn($specificationNode); $example->getTitle()->willReturn('title'); $specificationNode->getClassReflection()->willReturn($reflection); $coverageSession->start(__CLASS__ . ' => title')->shouldBeCalled(); $this->beforeExample($event); }
function it_should_start_coverage_on_beforeStep_event(CodeCoverageSession $coverageSession, StepEvent $stepEvent, StepNode $stepNode, ScenarioNode $scenarioNode) { $stepEvent->getStep()->willReturn($stepNode); $stepNode->getText()->willReturn('text'); $stepNode->getParent()->willReturn($scenarioNode); $stepNode->getFile()->willReturn('some_file'); $stepNode->getLine()->willReturn(1); $stepNode->getType()->willReturn('type'); $coverageSession->start('some_file on type text line: 1')->shouldBeCalled(); $this->beforeStep($stepEvent); }
function it_should_start_coverage_test_started(CodeCoverageSession $coverageRunner, MockTestCase $test) { $coverageRunner->start(Argument::containingString('test_name'))->shouldBeCalled(); $this->startTest($test); }
private function startCoverage($name) { if ($this->coverageSession) { $this->coverageSession->start($name); } }