process() public method

Process the transition for the statemachine and execute the associated Command with the domain object injected.
public process ( Context $context ) : void
$context Context
return void
 /**
  * @test
  */
 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));
 }