izzum\statemachine\TransitionTest::shouldWorkWhenCallingPublicMethodsWithNonDefaultConstructorValues PHP Method

shouldWorkWhenCallingPublicMethodsWithNonDefaultConstructorValues() public method

    public function shouldWorkWhenCallingPublicMethodsWithNonDefaultConstructorValues()
    {
        $from = new State('a');
        $to = new State('b');
        $rule = 'izzum\\rules\\FalseRule';
        $command = 'izzum\\command\\SimpleCommand';
        // declared in this file
        $object = new Context(new Identifier(Identifier::NULL_ENTITY_ID, Identifier::NULL_STATEMACHINE));
        $transition = new Transition($from, $to, null, $rule, $command);
        $this->assertEquals($from . '_to_' . $to, $transition->getName());
        $this->assertEquals($from, $transition->getStateFrom());
        $this->assertEquals($to, $transition->getStateTo());
        $this->assertContains($transition->getName(), $transition->toString());
        $command = $transition->getCommand($object);
        $rule = $transition->getRule($object);
        $this->assertTrue(is_a($command, 'izzum\\command\\Composite'));
        $this->assertContains('izzum\\command\\SimpleCommand', $command->toString());
        $this->assertTrue(is_a($rule, 'izzum\\rules\\AndRule'));
        $this->assertFalse($rule->applies());
    }