Elgg\RouterTest::testRouteSupportsSettingHandlerInHookResultForBackwardsCompatibility PHP Метод

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

3. Route a request for a /bar page. 4. Check that the /foo handler was called.
    function testRouteSupportsSettingHandlerInHookResultForBackwardsCompatibility()
    {
        $this->router->registerPageHandler('foo', array($this, 'foo_page_handler'));
        $this->hooks->registerHandler('route', 'bar', array($this, 'bar_route_handler'));
        ob_start();
        $this->router->route($this->prepareHttpRequest('bar/baz'));
        ob_end_clean();
        $this->assertEquals(1, $this->fooHandlerCalls);
        $response = _elgg_services()->responseFactory->getSentResponse();
        $this->assertInstanceOf(Response::class, $response);
    }
RouterTest