2 declare(strict_types = 1);
19 use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
28 $this->testExtensionsToLoad[] =
'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_meta';
31 $this->importDataSet(ORIGINAL_ROOT .
'typo3/sysext/core/Tests/Functional/Fixtures/Scenarios/pages_with_plugins_seo_meta.xml');
45 'page:uid:1' => [1,
false],
46 'page:uid:2' => [2,
true],
47 'page:uid:3' => [3,
true],
48 'page:uid:4' => [4,
true],
49 'page:uid:5' => [5,
true],
61 $this->setUpFrontendRootPage(1, [
'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_meta/Configuration/TypoScript/page' . $pageId .
'.typoscript']);
62 $response = $this->executeFrontendRequest(
63 (
new InternalRequest(
'http://localhost/'))->withQueryParameters([
67 $body = (string)$response->getBody();
68 $this->assertStringContainsString(
'<h1>MetaData-Test</h1>', $body);
69 if ($expectPluginOutput) {
70 $this->assertStringContainsString(
'TYPO3\CMS\TestMeta\Controller::setMetaData', $body);
72 $this->assertStringNotContainsString(
'TYPO3\CMS\TestMeta\Controller::setMetaData', $body);
79 'page:uid:1' => [1,
'Rootpage for Tests',
''],
80 'page:uid:2' => [2,
'static title with pageId: 2 and pluginNumber: 20',
'OG title from a controller with pageId: 2 and pluginNumber: 20'],
81 'page:uid:3' => [3,
'static title with pageId: 3 and pluginNumber: 20',
'OG title from a controller with pageId: 3 and pluginNumber: 20'],
82 'page:uid:4' => [4,
'static title with pageId: 4 and pluginNumber: 20',
'OG title from a controller with pageId: 4 and pluginNumber: 20'],
83 'page:uid:5' => [5,
'static title with pageId: 5 and pluginNumber: 10',
'OG title from a controller with pageId: 5 and pluginNumber: 10'],
84 'page:uid:6' => [6,
'static title with pageId: 6 and pluginNumber: 10',
'OG title from a controller with pageId: 6 and pluginNumber: 20'],
100 $this->setUpFrontendRootPage(1, [
'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_meta/Configuration/TypoScript/page' . $pageId .
'.typoscript']);
103 $uncachedResponse = $this->executeFrontendRequest(
104 (
new InternalRequest(
'http://localhost/'))->withQueryParameters([
108 $body = (string)$uncachedResponse->getBody();
109 $this->assertStringContainsString(
'<title>' . $expectedTitle .
'</title>', $body);
110 if ($expectedMetaOgTitle !==
'') {
111 $this->assertStringContainsString(
'<meta name="og:title" content="' . $expectedMetaOgTitle .
'" />', $body,
'first hit, not cached');
115 $cachedResponse = $this->executeFrontendRequest(
116 (
new InternalRequest(
'http://localhost/'))->withQueryParameters([
120 $body = (string)$cachedResponse->getBody();
121 $this->assertStringContainsString(
'<title>' . $expectedTitle .
'</title>', $body);
122 if ($expectedMetaOgTitle !==
'') {
123 $this->assertStringContainsString(
'<meta name="og:title" content="' . $expectedMetaOgTitle .
'" />', $body,
'second hit, cached');