Metabor\Statemachine\Factory\WeightTransitionTest::testThrowsAnExceptionIfMoreThanOneTransitionHasHighestWeight PHP Method

testThrowsAnExceptionIfMoreThanOneTransitionHasHighestWeight() public method

    public function testThrowsAnExceptionIfMoreThanOneTransitionHasHighestWeight()
    {
        $targetState = new State('TargetState');
        $transitions = array();
        $transition = new Transition($targetState);
        $transition->setWeight(0.001);
        $transitions[] = $transition;
        $transition = new Transition($targetState);
        $transition->setWeight(0.001);
        $transitions[] = $transition;
        $selector = new WeightTransition();
        $this->setExpectedException('\\RuntimeException');
        $selector->selectTransition(new \ArrayIterator($transitions));
    }