‪TYPO3CMS  10.4
ScenarioATest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
42 {
43  protected function ‪setUp(): void
44  {
45  parent::setUp();
46 
48  'acme-com',
49  $this->‪buildSiteConfiguration(1000, 'https://acme.com/'),
50  [
51  $this->‪buildDefaultLanguageConfiguration('EN', 'https://acme.com/en'),
52  $this->‪buildLanguageConfiguration('DE', 'https://acme.com/de'),
53  $this->‪buildLanguageConfiguration('DE-CH', 'https://acme.com/de-ch', ['DE']),
54  ]
55  );
56 
57  $this->‪setUpDatabaseWithYamlPayload(__DIR__ . '/Fixtures/ScenarioA.yaml');
58  }
59 
63  public function ‪resolvablePagesDataProvider(): array
64  {
65  return [
66  'home page in EN' => [
67  'url' => 'https://acme.com/en/hello',
68  'scopes' => [
69  'page/title' => 'EN: Welcome',
70  ],
71  ],
72  'home page in DE where page translation exists' => [
73  'url' => 'https://acme.com/de/willkommen',
74  'scopes' => [
75  'page/title' => 'DE: Willkommen',
76  ],
77  ],
78  'home page in DE-CH where page translation does not exist' => [
79  'url' => 'https://acme.com/de-ch/willkommen',
80  'scopes' => [
81  'page/title' => 'DE: Willkommen',
82  ],
83  ],
84  ];
85  }
86 
94  public function ‪resolvedPagesMatchScopes(string $url, array $scopes): void
95  {
96  $this->‪assertScopes($url, $scopes);
97  }
98 
102  public function ‪menuDataProvider(): array
103  {
104  return [
105  [
106  'url' => 'https://acme.com/en/hello',
107  'menu' => [
108  ['title' => 'EN: Welcome', 'link' => '/en/hello'],
109  ],
110  ],
111  [
112  'url' => 'https://acme.com/de/willkommen',
113  'menu' => [
114  ['title' => 'DE: Willkommen', 'link' => '/de/willkommen'],
115  ],
116  ],
117  [
118  'url' => 'https://acme.com/de-ch/willkommen',
119  'menu' => [
120  ['title' => 'DE: Willkommen', 'link' => '/de-ch/willkommen'],
121  ],
122  ],
123  ];
124  }
125 
133  public function ‪pageMenuIsRendered(string $url, array $expectedMenu): void
134  {
135  $this->‪assertMenu($url, $expectedMenu);
136  }
137 }
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\AbstractLocalizedPagesTestCase\assertScopes
‪assertScopes(string $url, array $scopes)
Definition: AbstractLocalizedPagesTestCase.php:90
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\ScenarioATest\setUp
‪setUp()
Definition: ScenarioATest.php:43
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildLanguageConfiguration
‪array buildLanguageConfiguration(string $identifier, string $base, array $fallbackIdentifiers=[], string $fallbackType=null)
Definition: SiteBasedTestTrait.php:142
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\writeSiteConfiguration
‪writeSiteConfiguration(string $identifier, array $site=[], array $languages=[], array $errorHandling=[])
Definition: SiteBasedTestTrait.php:58
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering
Definition: AbstractLocalizedPagesTestCase.php:18
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\ScenarioATest\resolvedPagesMatchScopes
‪resolvedPagesMatchScopes(string $url, array $scopes)
Definition: ScenarioATest.php:94
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\AbstractLocalizedPagesTestCase
Definition: AbstractLocalizedPagesTestCase.php:29
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\ScenarioATest\resolvablePagesDataProvider
‪array resolvablePagesDataProvider()
Definition: ScenarioATest.php:63
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildDefaultLanguageConfiguration
‪array buildDefaultLanguageConfiguration(string $identifier, string $base)
Definition: SiteBasedTestTrait.php:124
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\ScenarioATest\pageMenuIsRendered
‪pageMenuIsRendered(string $url, array $expectedMenu)
Definition: ScenarioATest.php:133
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\ScenarioATest\menuDataProvider
‪array menuDataProvider()
Definition: ScenarioATest.php:102
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\AbstractLocalizedPagesTestCase\assertMenu
‪assertMenu(string $url, array $expectation)
Definition: AbstractLocalizedPagesTestCase.php:128
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\AbstractLocalizedPagesTestCase\setUpDatabaseWithYamlPayload
‪setUpDatabaseWithYamlPayload(string $pathToYamlFile)
Definition: AbstractLocalizedPagesTestCase.php:65
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\ScenarioATest
Definition: ScenarioATest.php:42
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildSiteConfiguration
‪array buildSiteConfiguration(int $rootPageId, string $base='')
Definition: SiteBasedTestTrait.php:109