protected function getStateMachine() { if ($this->_stateMachineProxy == null) { $this->_stateMachineProxy = new StateMachineProxy(StateMachine::getStateMachineFor(get_called_class()), $this); } return $this->_stateMachineProxy; }
public function testRegistersMachine() { $stub = new SimpleStub(); $this->assertNotNull(StateMachine::getStateMachineFor('SimpleStub')); }
public function testAutoRegistersMachine() { $machine = new StateMachine('DynamicModel'); $this->assertEquals($machine, StateMachine::getStateMachineFor('DynamicModel')); }