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:----gOUnEODB+0dg3zAjrYNMlynQPGJNDmDLwW3scUM4gd9F/ygNeRGb5OnY3lSwJy2GyApFl2WNhINVlcVDrP0y8oqbcZhH5vHh1nkQFVLwyVS91QJSDiAtI7YMVLlkBWn3a/TEUEX2pgczp6w0EKSF046f/Przpmw2L9gOCf5I4bTDQ8yDighk9UFSmq/Oeob62PSAB2ti9VkFtOAJsHpH23OY0Hjo6KuqtGGBxZ+XuuZa4G9t3KheM0BcyCqq1/mgu7hlw1YNIK5LE4L0MuInVJ3fWwc/kF/UkMTaF4SyoD6BkSfZDGmDilKLk4efKSPgKfV4e7r3+Osc2DgtvDQaReuyhfqmYAodlGb9vu4CMCWDnJaiwzX6EQO4c0tBA6mPc5BpkvwSBtEZK7iTowVE3jNDWmaDYrH0E/NMTO+brFpkH5S1MgC3lnSI9mMoFuUse4Uv9JBtDfC9tnMK39Ae2xdhLV4Gmfi6GK7+I4maHiLnioDr2RuALhllMNRWImq7s0Jh2mB8yZhPq3WEAFWmlD9lO3B6SPPkoAxDM9/KnpTsDtSTaDc7Tywi2DfF2cNc3yHUc6RW7Vp1jeOipVfhAsIMgNEIgffuuLrNJ/ibHJSB+BxQy7nhrjvD1fCf8YfZRN8X6xq4pGRk1Xw/YSahneIXeq4ZESORBR6if6eyz3g=----ATTACHMENT:----OTA0ODEyMTk1NjM0NjIzOSA2MDgzMTY2NDkzNDQ1NzQzIDYwMDcwMjI1MDk2MzY2NQ==