function it_calls_the_command_bus(CommandBus $commandBus, Resource $resource) { $resource->getSrcFilename()->willReturn(self::FILE_NAME); $resource->getSrcNamespace()->willReturn(self::NAME_SPACE); $resource->getSrcClassname()->willReturn(self::CLASS_NAME); $data = ['name' => self::METHOD_NAME, 'arguments' => []]; $command = Argument::type(GenerateConstructor::class); $commandBus->handle($command)->shouldbeCalled(); $this->generate($resource, $data); }
function it_handles_commands(Command $command, CommandBus $commandBus) { $commandBus->handle($command)->shouldBeCalled(); $this->handle($command); }