spec\PhpSpec\Wrapper\Subject\Expectation\DispatcherDecoratorSpec::it_decorates_expectation_with_broken_event PHP Метод

it_decorates_expectation_with_broken_event() публичный Метод

public it_decorates_expectation_with_broken_event ( PhpSpec\Wrapper\Subject\Expectation\Expectation $expectation, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher )
$expectation PhpSpec\Wrapper\Subject\Expectation\Expectation
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
    function it_decorates_expectation_with_broken_event(Expectation $expectation, EventDispatcherInterface $dispatcher)
    {
        $alias = 'be';
        $subject = new \stdClass();
        $arguments = array();
        $expectation->match(Argument::cetera())->willThrow('\\RuntimeException');
        $dispatcher->dispatch('beforeExpectation', Argument::type('PhpSpec\\Event\\ExpectationEvent'))->shouldBeCalled();
        $dispatcher->dispatch('afterExpectation', Argument::which('getResult', ExpectationEvent::BROKEN))->shouldBeCalled();
        $this->shouldThrow('\\RuntimeException')->duringMatch($alias, $subject, $arguments);
    }