[TASK] Add full configuration to SiteLanguage::toArray
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Unit / Site / Entity / SiteLanguageTest.php
1 <?php
2 declare(strict_types = 1);
3
4 namespace TYPO3\CMS\Core\Tests\Unit\Site\Entity;
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
19 use TYPO3\CMS\Core\Http\Uri;
20 use TYPO3\CMS\Core\Site\Entity\SiteLanguage;
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
22
23 class SiteLanguageTest extends UnitTestCase
24 {
25 /**
26 * @test
27 */
28 public function toArrayReturnsProperOverlaidData()
29 {
30 $configuration = [
31 'navigationTitle' => 'NavTitle',
32 'customValue' => 'a custom value'
33 ];
34 $subject = new SiteLanguage(1, 'de', new Uri('/'), $configuration);
35 $expected = [
36 'languageId' => 1,
37 'locale' => 'de',
38 'base' => '/',
39 'title' => 'Default',
40 'navigationTitle' => 'NavTitle',
41 'twoLetterIsoCode' => 'en',
42 'hreflang' => 'en-US',
43 'direction' => '',
44 'typo3Language' => 'default',
45 'flagIdentifier' => '',
46 'fallbackType' => 'strict',
47 'enabled' => true,
48 'fallbackLanguageIds' => [],
49 'customValue' => 'a custom value'
50 ];
51 $this->assertEquals($expected, $subject->toArray());
52 }
53 }