validate($definition, 'foo'); // The graph looks like: // // +----+ +----+ +---+ // | a | --> | t1 | --> | b | // +----+ +----+ +---+ // | // | // v // +----+ +----+ // | t1 | --> | c | // +----+ +----+ } /** * @expectedException \Symfony\Component\Workflow\Exception\InvalidDefinitionException * @expectedExceptionMessage A transition in StateMachine can only have one output. */ public function testWithMultipleTos() { $places = array('a', 'b', 'c'); $transitions[] = new Transition('t1', 'a', array('b', 'c')); $definition = new Definition($places, $transitions); (new StateMachineValidator())->validate($definition, 'foo'); // The graph looks like: // // +---+ +----+ +---+ // | a | --> | t1 | --> | b | // +---+ +----+ +---+ // | // | // v // +----+ // | c | // +----+ } /** * @expectedException \Symfony\Component\Workflow\Exception\InvalidDefinitionException * @expectedExceptionMessage A transition in StateMachine can only have one input. */ public function testWithMultipleFroms() { $places = array('a', 'b', 'c'); $transitions[] = new Transition('t1', array('a', 'b'), 'c'); $definition = new Definition($places, $transitions); (new StateMachineValidator())->validate($definition, 'foo'); // The graph looks like: // // +---+ +----+ +---+ // | a | --> | t1 | --> | c | // +---+ +----+ +---+ // ^ // | // | // +----+ // | b | // +----+ } public function testValid() { $places = array('a', 'b', 'c'); $transitions[] = new Transition('t1', 'a', 'b'); $transitions[] = new Transition('t2', 'a', 'c'); $definition = new Definition($places, $transitions); (new StateMachineValidator())->validate($definition, 'foo'); // the test simply ensures that the validation does not fail (i.e. it does not throw any exceptions) $this->addToAssertionCount(1); // The graph looks like: // // +----+ +----+ +---+ // | a | --> | t1 | --> | b | // +----+ +----+ +---+ // | // | // v // +----+ +----+ // | t2 | --> | c | // +----+ +----+ } } __halt_compiler();----SIGNATURE:----k/y2FkpKSDdY97QalrDu2sy8j+g9dir195x+XN2ecxkIIz1hq80/0JvAtM0APN/EVayeRqvuUyrVrtSsMzXSRAIt8DfFxrKJwI0fn85HAC4ntVNeFRcM2Ox0Rq+nV9sVE5p5Hj3TkBAGslUZO5mitXqx2M16vS/kCr2QPa2VuOzZr/Fmy0pQ9J0axu5Ic8rQUziGpaDo8ekhukCjtA5xF9WlnuKrZJ3l/Ynx8T8rFGPSl3tjlZTeKDh98OgiPJbs6N7uzkezR+O042cezD8FwUuSX17OdmlZMlC6/v7zXe0tcQdfJePAR1CoiwAV8kSxwPi0txu572uuSF7ZaQAe8Y6qxSTMFMFhfWw+lkejYkenBylyARYh+SS+ImzLbHZsVX7USolU9wPFoRwJd+bDqu+lcEMimxYiLS58aMRIYqnLGOXAJS7XyhvZu/eOC9riFF5R6Mi6Vwajkg/ltK2LwYhEPpn9UhLOeyX82D6Sm3ZttkxBKn6Vy8/S9BGlFma3X0Hh96lBHzPX8dl9DaTOYy4PT0HpqBkJSHRSdYgxhez8Kt9P7moJ3+fe6T23jzTmlWpwM961HZDAGgfQOee0O7RaAy/Vmym8hcrdPMxxI2LQVFgSQOPp5vqGnLXiTQHq6Unc/GTKCUTs4FBMGMQBZWmQdiq3Jx6XotklGDWnW1o=----ATTACHMENT:----MTMyMTU3ODY4MzAzMjI3NSAzNzc4MzE2ODk3Njk0NzU2IDk5NjI3MjM4MTk5NzgyMQ==