Phalcon\Test\Unit\Mvc\MicroTest::testMicroEvents PHP Метод

testMicroEvents() публичный Метод

public testMicroEvents ( )
    public function testMicroEvents()
    {
        $this->specify("Micro event handlers don't work as expected", function () {
            $trace = [];
            $eventsManager = new EventsManager();
            $eventsManager->attach('micro', function ($event) use(&$trace) {
                $trace[$event->getType()] = true;
            });
            $app = new Micro();
            $app->setEventsManager($eventsManager);
            $app->map("/blog", function () {
            });
            $app->handle("/blog");
            expect($trace)->equals(["beforeHandleRoute" => true, "beforeExecuteRoute" => true, "afterExecuteRoute" => true, "afterHandleRoute" => true]);
        });
    }