spec\PhpSpec\Formatter\DotFormatterSpec::it_outputs_exceptions_for_failed_examples PHP Method

it_outputs_exceptions_for_failed_examples() public method

public it_outputs_exceptions_for_failed_examples ( SuiteEvent $event, ExampleEvent $pendingEvent, ConsoleIO $io, PhpSpec\Listener\StatisticsCollector $stats, SpecificationNode $specification, ExampleNode $example )
$event PhpSpec\Event\SuiteEvent
$pendingEvent PhpSpec\Event\ExampleEvent
$io PhpSpec\Console\ConsoleIO
$stats PhpSpec\Listener\StatisticsCollector
$specification PhpSpec\Loader\Node\SpecificationNode
$example PhpSpec\Loader\Node\ExampleNode
    function it_outputs_exceptions_for_failed_examples(SuiteEvent $event, ExampleEvent $pendingEvent, ConsoleIO $io, StatisticsCollector $stats, SpecificationNode $specification, ExampleNode $example)
    {
        $example->getLineNumber()->willReturn(37);
        $example->getTitle()->willReturn('it tests something');
        $pendingEvent->getException()->willReturn(new PendingException());
        $pendingEvent->getSpecification()->willReturn($specification);
        $pendingEvent->getExample()->willReturn($example);
        $stats->getEventsCount()->willReturn(1);
        $stats->getFailedEvents()->willReturn(array());
        $stats->getBrokenEvents()->willReturn(array());
        $stats->getPendingEvents()->willReturn(array($pendingEvent));
        $stats->getSkippedEvents()->willReturn(array());
        $stats->getTotalSpecs()->willReturn(1);
        $stats->getCountsHash()->willReturn(array('passed' => 0, 'pending' => 1, 'skipped' => 0, 'failed' => 0, 'broken' => 0));
        $this->afterSuite($event);
        $expected = '<lineno>  37</lineno>  <pending>- it tests something</pending>';
        $io->writeln($expected)->shouldHaveBeenCalled();
    }