示例#1
0
 public function test_can_be_constructed_with_initial_state_callback()
 {
     $stateMachine = new StateMachine(function () {
         return 'a';
     });
     $this->assertEquals('a', $stateMachine->getCurrentState());
 }
示例#2
0
 /**
  * @param string $event
  * @param string $expectedState
  */
 private function fireAndAssertState($event, $expectedState)
 {
     $this->stateMachine->fire($event);
     $this->assertEquals($expectedState, $this->stateMachine->getCurrentState());
 }