/** * @param ExampleEvent $event */ public function afterExample(ExampleEvent $event) { $reportLine = $this->reportItemFactory->create($event, $this->getPresenter()); $reportLine->write($this->index - 1); $this->getIO()->write(PHP_EOL); }
function it_delegates_the_reporting_to_the_event_type_line_reporter(ExampleEvent $event, ReportItem $item, ReportItemFactory $factory, Presenter $presenter) { $factory->create($event, $presenter)->willReturn($item); $item->write(Argument::any())->shouldBeCalled(); $this->afterExample($event); }