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