ProophTest\ServiceBus\Plugin\InvokeStrategy\AbstractInvokeStrategyTest::it_fetches_message_and_handler_and_invokes_them_if_possible PHP Method

it_fetches_message_and_handler_and_invokes_them_if_possible() public method

    public function it_fetches_message_and_handler_and_invokes_them_if_possible()
    {
        $actionEventMock = $this->getMockForAbstractClass(ActionEvent::class);
        $actionEventMock->expects($this->at(0))->method('getParam')->with(MessageBus::EVENT_PARAM_MESSAGE)->will($this->returnValue('message'));
        $actionEventMock->expects($this->at(1))->method('getParam')->with(MessageBus::EVENT_PARAM_MESSAGE_HANDLER)->will($this->returnValue('handler'));
        $actionEventMock->expects($this->at(2))->method('setParam')->with(MessageBus::EVENT_PARAM_MESSAGE_HANDLED, true);
        $strategy = $this->getMockForAbstractClass(AbstractInvokeStrategy::class);
        $strategy->expects($this->once())->method('canInvoke')->with('handler', 'message')->will($this->returnValue(true));
        $strategy->expects($this->once())->method('invoke')->with('handler', 'message');
        $strategy($actionEventMock);
    }