Elgg\RouterTest::testCanRespondToAjaxViewRequestForCacheableView PHP Method

testCanRespondToAjaxViewRequestForCacheableView() public method

    public function testCanRespondToAjaxViewRequestForCacheableView()
    {
        $this->assertTrue(_elgg_services()->views->isCacheableView('cacheable.xml'));
        $this->request = $this->prepareHttpRequest('ajax/view/cacheable.xml', 'GET', [], 1);
        $this->createService();
        $this->route();
        $response = _elgg_services()->responseFactory->getSentResponse();
        $this->assertInstanceOf(Response::class, $response);
        $this->assertEquals(ELGG_HTTP_OK, $response->getStatusCode());
        $this->assertEquals(file_get_contents($this->viewsDir . '/default/cacheable.xml'), $response->getContent());
        $this->assertContains('application/xml', $response->headers->get('Content-Type'));
    }
RouterTest