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:----EVCwoWHYObxP8BOp5emOhpKADq9/WMTjHyt+HbYE2S1rMSYJpzUMdUuHSVll/wJ7CQ65DvKyS/g81V0TAZilOmkPl1ISxEUxT7uX0J3GmA749qm9DdWUWWUWjtax8KBrIvAdVVAC6dYrCCNYApmMG30nckxS/33utaQVRVJiAtVsdIUIecRLiJcupmLCKaVqDh3q3bIBDg13Ng6b8UPe5eLvzRTVu7VdkZ4AiEJfFP8b9O+IRZ0euaS/a7f02MUs4VtszUC5JQEbZl3z7wIh7aEZeYEv8yDvnv2A/mr8z4myGYgnwh6JH1uVVS60yePCJ5wpoQFMOXZEimDbLj3QQKv9WdD2WbSD/1m2XuGIPwJPiKOzQ69H227K6hSDijcUyfwCUlbrjndlJAOIOPWYDOVvtPPNU/Om4ppErk/0vQq8gawA6mgWyxHDZoGhSHD9laUlktBFDpgw8yiJWwVdgWHefHId3/IELDKU6hX8G7BWKPCtaklOQM+RayXvdcs5jkLouY0dWV7NLbU9/mbqKiYSADNQCxv/RLI9NRstLOIF7eiiDXeAghMT1M7e9uMjSzRT2xwM/eSndRG1MAC+IMFMFgq5krgSxFtWb8G894tEygBEagqC3adpweF+7fYox4bac2ot2sA7QLUqW4cV1X1hzqB9HArImNlKWUZngZ8=----ATTACHMENT:----MjgzMjkxMDEzMzEwNTMxIDk5NTUxMDIyNjA1Njk4MzcgODM3MTM1MTc5ODUyODAwNg==