izzum\statemachine\Transition::getStateTo PHP Метод

getStateTo() публичный Метод

get the state this transition points to
public getStateTo ( ) : State
Результат State
    public function getStateTo()
    {
        return $this->state_to;
    }

Usage Example

 /**
  * @test
  */
 public function shouldExpectExceptionsWhenCallingPublicMethodsWithNonDefaultConstructorValues()
 {
     $from = new State('a');
     $to = new State('b');
     $rule = 'izzum\\rules\\BOGUS';
     $command = 'izzum\\command\\BOGUS';
     $object = new Context(new Identifier(Identifier::NULL_ENTITY_ID, Identifier::NULL_STATEMACHINE));
     $transition = new Transition($from, $to, null, $rule, $command);
     $this->assertEquals($from . '_to_' . $to, $transition->getName());
     $this->assertEquals($from, $transition->getStateFrom());
     $this->assertEquals($to, $transition->getStateTo());
     $this->assertContains($transition->getName(), $transition->toString());
     try {
         $command = $transition->getCommand($object);
         $this->fail('should not come here');
     } catch (Exception $e) {
         $this->assertEquals(Exception::COMMAND_CREATION_FAILURE, $e->getCode());
     }
     try {
         $rule = $transition->getRule($object);
         $this->fail('should not come here');
     } catch (Exception $e) {
         $this->assertEquals(Exception::RULE_CREATION_FAILURE, $e->getCode());
     }
 }
All Usage Examples Of izzum\statemachine\Transition::getStateTo