‪TYPO3CMS  9.5
PseudoSiteTest.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 
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
22 
23 class ‪PseudoSiteTest extends UnitTestCase
24 {
29  {
30  return [
31  'no domain' => [
32  [],
33  [
34  new ‪Uri('/')
35  ],
36  new ‪Uri('/')
37  ],
38  'invalid domain argument' => [
39  [
40  ['domain_name' => 'not.recognized.com']
41  ],
42  [
43  new ‪Uri('/')
44  ],
45  new ‪Uri('/')
46  ],
47  'regular domain given' => [
48  [
49  ['domainName' => 'blog.example.com/download']
50  ],
51  [
52  new ‪Uri('//blog.example.com/download')
53  ],
54  new ‪Uri('//blog.example.com/download')
55  ],
56  'multiple domains given' => [
57  [
58  ['domainName' => 'www.example.com'],
59  ['domainName' => 'blog.example.com'],
60  ['domainName' => 'blog.example.com/food-koma'],
61  ],
62  [
63  new ‪Uri('//www.example.com'),
64  new ‪Uri('//blog.example.com'),
65  new ‪Uri('//blog.example.com/food-koma'),
66  ],
67  new ‪Uri('//www.example.com')
68  ]
69  ];
70  }
71 
76  public function ‪pseudoSiteReturnsProperEntryPoints($sysDomainRecords, $expectedResolvedEntryPoints, $expectedFirstEntryPoint)
77  {
78  $subject = new ‪PseudoSite(13, ['domains' => $sysDomainRecords, 'languages' => []]);
79  $this->assertEquals($expectedResolvedEntryPoints, $subject->getEntryPoints());
80  $this->assertEquals($expectedFirstEntryPoint, $subject->getBase());
81  }
82 }
‪TYPO3\CMS\Core\Tests\Unit\Site\Entity
Definition: PseudoSiteTest.php:4
‪TYPO3\CMS\Core\Tests\Unit\Site\Entity\PseudoSiteTest\pseudoSiteReturnsProperEntryPoints
‪pseudoSiteReturnsProperEntryPoints($sysDomainRecords, $expectedResolvedEntryPoints, $expectedFirstEntryPoint)
Definition: PseudoSiteTest.php:76
‪TYPO3\CMS\Core\Http\Uri
Definition: Uri.php:27
‪TYPO3\CMS\Core\Site\Entity\PseudoSite
Definition: PseudoSite.php:28
‪TYPO3\CMS\Core\Tests\Unit\Site\Entity\PseudoSiteTest\pseudoSiteReturnsProperEntryPointsDataProvider
‪array pseudoSiteReturnsProperEntryPointsDataProvider()
Definition: PseudoSiteTest.php:28
‪TYPO3\CMS\Core\Tests\Unit\Site\Entity\PseudoSiteTest
Definition: PseudoSiteTest.php:24