spec\PhpSpec\Runner\ExampleRunnerSpec::it_dispatches_ExampleEvent_with_failed_status_if_matcher_throws_exception PHP Method

it_dispatches_ExampleEvent_with_failed_status_if_matcher_throws_exception() public method

public it_dispatches_ExampleEvent_with_failed_status_if_matcher_throws_exception ( Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher, ExampleNode $example, ReflectionMethod $exampReflection, PhpSpec\Specification $context )
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$example PhpSpec\Loader\Node\ExampleNode
$exampReflection ReflectionMethod
$context PhpSpec\Specification
    function it_dispatches_ExampleEvent_with_failed_status_if_matcher_throws_exception(EventDispatcherInterface $dispatcher, ExampleNode $example, ReflectionMethod $exampReflection, Specification $context)
    {
        $example->isPending()->willReturn(false);
        $exampReflection->getParameters()->willReturn(array());
        $exampReflection->invokeArgs($context, array())->willThrow('PhpSpec\\Exception\\Example\\FailureException');
        $dispatcher->dispatch('beforeExample', Argument::any())->shouldBeCalled();
        $dispatcher->dispatch('afterExample', Argument::which('getResult', ExampleEvent::FAILED))->shouldBeCalled();
        $this->run($example);
    }