コード例 #1
0
 protected function getStateMachine()
 {
     if ($this->_stateMachineProxy == null) {
         $this->_stateMachineProxy = new StateMachineProxy(StateMachine::getStateMachineFor(get_called_class()), $this);
     }
     return $this->_stateMachineProxy;
 }
コード例 #2
0
 public function testRegistersMachine()
 {
     $stub = new SimpleStub();
     $this->assertNotNull(StateMachine::getStateMachineFor('SimpleStub'));
 }
コード例 #3
0
 public function testAutoRegistersMachine()
 {
     $machine = new StateMachine('DynamicModel');
     $this->assertEquals($machine, StateMachine::getStateMachineFor('DynamicModel'));
 }