/** * @command Malocher\CqrsTest\Coverage\Mock\Command\MockCommand * @param MockCommand $command */ public function handleAnnotationCommand(MockCommand $command) { if ($command instanceof MockCommand) { $command->edit(); } }
function testStateWithBrokenTransitions() { $command1 = new MockCommand($this); $command1->setReturnValue('perform', 'someStatus'); $this->state_machine->registerState('initial', $command1, array('some_status' => 'no_such_state')); $command2 = new MockCommand($this); $this->state_machine->registerState('next_state', $command2); try { $this->state_machine->run(); $this->assertTrue(false, 'Exception must be thrown here'); } catch(LimbException $e) { $this->assertEqual($e->getAdditionalParams() , array('state_name' => 'no_such_state', )); } }