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

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

    public function testMicroMiddlewareSimple()
    {
        $this->specify("Micro before/after/finish events don't work as expected", function () {
            $app = new Micro();
            $app->map("/api/site", function () {
                return true;
            });
            $trace = 0;
            $app->before(function () use(&$trace) {
                $trace++;
            });
            $app->before(function () use(&$trace) {
                $trace++;
            });
            $app->after(function () use(&$trace) {
                $trace++;
            });
            $app->after(function () use(&$trace) {
                $trace++;
            });
            $app->finish(function () use(&$trace) {
                $trace++;
            });
            $app->finish(function () use(&$trace) {
                $trace++;
            });
            $app->handle("/api/site");
            expect($trace)->equals(6);
        });
    }