Finite\Test\Loader\ArrayLoaderTest::testLoadCallbacks PHP Method

testLoadCallbacks() public method

public testLoadCallbacks ( )
    public function testLoadCallbacks()
    {
        $sm = $this->getMock('Finite\\StateMachine\\StateMachine');
        $allTimes = function () {
        };
        $beforeMiddleize = function () {
        };
        $fromStartToOtherThanMiddle = function () {
        };
        $this->object = new ArrayLoader(array('class' => 'Stateful1', 'states' => array('start' => array('type' => 'initial'), 'middle' => array(), 'end' => array('type' => 'final')), 'transitions' => array('middleize' => array('from' => 'start', 'to' => 'middle'), 'finish' => array('from' => array('middle'), 'to' => 'end')), 'callbacks' => array('before' => array(array('on' => 'middleize', 'do' => $beforeMiddleize), array('from' => 'start', 'to' => '-middle', 'do' => $fromStartToOtherThanMiddle)), 'after' => array(array('do' => $allTimes)))), $this->callbackHandler);
        $this->callbackHandler->expects($this->at(0))->method('addBefore')->with($this->isInstanceOf('Finite\\Event\\Callback\\Callback'));
        $this->callbackHandler->expects($this->at(1))->method('addBefore')->with($this->isInstanceOf('Finite\\Event\\Callback\\Callback'));
        $this->callbackHandler->expects($this->at(2))->method('addAfter')->with($this->isInstanceOf('Finite\\Event\\Callback\\Callback'));
        $this->object->load($sm);
    }