2 declare(strict_types = 1);
20 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
31 'core',
'frontend',
'seo'
34 protected function setUp()
37 $this->importDataSet(
'EXT:seo/Tests/Functional/Fixtures/pages-sitemap.xml');
38 $this->setUpFrontendRootPage(
41 'constants' => [
'EXT:seo/Configuration/TypoScript/XmlSitemap/constants.typoscript'],
42 'setup' => [
'EXT:seo/Configuration/TypoScript/XmlSitemap/setup.typoscript']
60 $response = $this->executeFrontendRequest(
61 (
new InternalRequest(
'http://localhost/'))->withQueryParameters([
67 $this->assertEquals(200, $response->getStatusCode());
68 $this->assertArrayHasKey(
'Content-Length', $response->getHeaders());
69 $this->assertGreaterThan(0, $response->getHeader(
'Content-Length')[0]);
70 $this->assertArrayHasKey(
'Content-Type', $response->getHeaders());
71 $this->assertEquals(
'application/xml;charset=utf-8', $response->getHeader(
'Content-Type')[0]);
72 $this->assertArrayHasKey(
'X-Robots-Tag', $response->getHeaders());
73 $this->assertEquals(
'noindex', $response->getHeader(
'X-Robots-Tag')[0]);
74 $this->assertRegExp(
'/<loc>http:\/\/localhost\/\?sitemap=pages&type=1533906435&cHash=[^<]+<\/loc>/', (
string)$response->getBody());