Elgg\RouterTest::testCanRespondToNonAjaxRequestFromRedirectResponseBuilder PHP Method

testCanRespondToNonAjaxRequestFromRedirectResponseBuilder() public method

    public function testCanRespondToNonAjaxRequestFromRedirectResponseBuilder()
    {
        $this->request = $this->prepareHttpRequest('foo/bar/baz', 'GET');
        $this->createService();
        elgg_register_page_handler('foo', function ($segments, $identifier) {
            $this->assertEquals(['bar', 'baz'], $segments);
            $this->assertEquals('foo', $identifier);
            return elgg_redirect_response('foo2/bar2/baz2');
        });
        $this->assertTrue($this->route());
        $response = _elgg_services()->responseFactory->getSentResponse();
        $this->assertInstanceOf(RedirectResponse::class, $response);
        $this->assertEquals(ELGG_HTTP_FOUND, $response->getStatusCode());
        $this->assertEquals(elgg_normalize_url('foo2/bar2/baz2'), $response->getTargetUrl());
    }
RouterTest