public function its_listener_can_accept_a_callable_as_a_matcher(BotInterface $bot, CommandInterface $command, Packet $packet) { $packet->offsetGet('command')->willReturn($command); $packet->offsetSet('output', null)->shouldBeCalled(); $packet->stopPropagation()->shouldBeCalled(); $bot->execute($command)->shouldBeCalled(); $listener = $this->getListener($bot, function ($command) { return true; }); $listener($packet); }