Phalcon\Test\Unit\Cli\ConsoleTest::testIssue787 PHP Method

testIssue787() public method

public testIssue787 ( )
    public function testIssue787()
    {
        $this->specify("Initializer isn't invoked if has been dispatcher call before", function () {
            $di = new CliFactoryDefault();
            $di->setShared('dispatcher', function () use($di) {
                $dispatcher = new Dispatcher();
                $dispatcher->setDI($di);
                return $dispatcher;
            });
            $console = new Console();
            $console->setDI($di);
            $console->handle(array('task' => 'issue787', 'action' => 'main'));
            expect(class_exists('Issue787Task'))->true();
            $actual = \Issue787Task::$output;
            $expected = "beforeExecuteRoute" . PHP_EOL . "initialize" . PHP_EOL;
            expect($actual)->equals($expected);
        });
    }