‪TYPO3CMS  ‪main
ScenarioGTest.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 
20 use PHPUnit\Framework\Attributes\DataProvider;
21 use PHPUnit\Framework\Attributes\Test;
22 
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', 'EN']),
53  ]
54  );
55 
56  $this->‪setUpDatabaseWithYamlPayload(__DIR__ . '/Fixtures/ScenarioG.yaml');
57  }
58 
59  public static function ‪menuDataProvider(): array
60  {
61  return [
62  [
63  'url' => 'https://acme.com/de-ch/willkommen',
64  'expectedMenu' => [
65  ['title' => 'DE-CH: Willkommen', 'link' => '/de-ch/willkommen'],
66  ['title' => 'DE: Über uns', 'link' => '/de-ch/ueber-uns'],
67  ['title' => 'DE: Abkürzung zu Über uns', 'link' => '/de-ch/ueber-uns'],
68  ],
69  ],
70  ];
71  }
72 
73  #[DataProvider('menuDataProvider')]
74  #[Test]
75  public function ‪pageMenuIsRendered(string ‪$url, array $expectedMenu): void
76  {
77  $this->‪assertMenu($url, $expectedMenu);
78  }
79 }
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildLanguageConfiguration
‪buildLanguageConfiguration(string $identifier, string $base, array $fallbackIdentifiers=[], string $fallbackType=null)
Definition: SiteBasedTestTrait.php:108
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\ScenarioGTest\pageMenuIsRendered
‪pageMenuIsRendered(string $url, array $expectedMenu)
Definition: ScenarioGTest.php:75
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\writeSiteConfiguration
‪writeSiteConfiguration(string $identifier, array $site=[], array $languages=[], array $errorHandling=[])
Definition: SiteBasedTestTrait.php:50
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering
Definition: AbstractLocalizedPagesTestCase.php:18
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\AbstractLocalizedPagesTestCase
Definition: AbstractLocalizedPagesTestCase.php:28
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildSiteConfiguration
‪buildSiteConfiguration(int $rootPageId, string $base='')
Definition: SiteBasedTestTrait.php:88
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\ScenarioGTest\menuDataProvider
‪static menuDataProvider()
Definition: ScenarioGTest.php:59
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\ScenarioGTest
Definition: ScenarioGTest.php:41
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\AbstractLocalizedPagesTestCase\assertMenu
‪assertMenu(string $url, array $expectation)
Definition: AbstractLocalizedPagesTestCase.php:77
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\AbstractLocalizedPagesTestCase\setUpDatabaseWithYamlPayload
‪setUpDatabaseWithYamlPayload(string $pathToYamlFile)
Definition: AbstractLocalizedPagesTestCase.php:35
‪TYPO3\CMS\Webhooks\Message\$url
‪identifier readonly UriInterface $url
Definition: LoginErrorOccurredMessage.php:36
‪TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait\buildDefaultLanguageConfiguration
‪buildDefaultLanguageConfiguration(string $identifier, string $base)
Definition: SiteBasedTestTrait.php:98
‪TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\ScenarioGTest\setUp
‪setUp()
Definition: ScenarioGTest.php:42