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

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

    public function testCanRespondToAjaxViewRequestForJS()
    {
        $this->request = $this->prepareHttpRequest('ajax/view/js/javascript.js', '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/javascript.js'), $response->getContent());
        $this->assertContains('text/javascript', $response->headers->get('Content-Type'));
        $this->assertContains('charset=utf-8', strtolower($response->headers->get('Content-Type')));
    }
RouterTest