public function testGoodAssert() { $fsm = new Fsm('fsm'); $fsm->setStates(array(new State('s1'), new State('s2'), new State('s3')))->setTransitions(array(new Transition('t1', 's1', 's2'), new Transition('t2', 's2', 's3'))); $assert = new NoTransitionWithUndefinedStatesAssert(); $assert->validate($fsm, false); }
public function validate(FsmInterface $fsm) { $v1 = new NoDuplicateStatesAssert(); $v1->validate($fsm); $v2 = new NoDuplicateTransitionNamesAssert(); $v2->validate($fsm); $v3 = new NoTransitionWithUndefinedStatesAssert(); $v3->validate($fsm); $v4 = new AtLeastOneInitialStateAssert(); $v4->validate($fsm); }