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

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

public it_decorates_expectation_with_failed_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_failed_event(Expectation $expectation, EventDispatcherInterface $dispatcher)
    {
        $alias = 'be';
        $subject = new \stdClass();
        $arguments = array();
        $expectation->match(Argument::cetera())->willThrow('PhpSpec\\Exception\\Example\\FailureException');
        $dispatcher->dispatch('beforeExpectation', Argument::type('PhpSpec\\Event\\ExpectationEvent'))->shouldBeCalled();
        $dispatcher->dispatch('afterExpectation', Argument::which('getResult', ExpectationEvent::FAILED))->shouldBeCalled();
        $this->shouldThrow('PhpSpec\\Exception\\Example\\FailureException')->duringMatch($alias, $subject, $arguments);
    }