izzum\statemachine\TransitionTest::shouldThrowExceptionFromAppliedCommand PHP Method

shouldThrowExceptionFromAppliedCommand() public method

    public function shouldThrowExceptionFromAppliedCommand()
    {
        $from = new State('a');
        $to = new State('b');
        $rule = 'izzum\\rules\\TrueRule';
        $command = 'izzum\\command\\ExceptionCommand';
        $object = new Context(new Identifier(Identifier::NULL_ENTITY_ID, Identifier::NULL_STATEMACHINE));
        $transition = new Transition($from, $to, null, $rule, $command);
        try {
            $transition->process($object);
            $this->fail('should not come here');
        } catch (Exception $e) {
            $this->assertEquals(Exception::COMMAND_EXECUTION_FAILURE, $e->getCode());
        }
        $this->assertTrue($transition->can($object));
    }