‪TYPO3CMS  ‪main
BeforeRedirectMatchDomainEventTest.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\Test;
22 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
23 
24 final class ‪BeforeRedirectMatchDomainEventTest extends UnitTestCase
25 {
26  #[Test]
27  public function ‪getterReturnsConstructorSetValues(): void
28  {
29  $event = new ‪BeforeRedirectMatchDomainEvent('acme.com', '/some-path', '?param=value', '*');
30 
31  self::assertSame('acme.com', $event->getDomain());
32  self::assertSame('/some-path', $event->getPath());
33  self::assertSame('?param=value', $event->getQuery());
34  self::assertSame('*', $event->getMatchDomainName());
35  self::assertNull($event->getMatchedRedirect());
36  }
37 
38  #[Test]
40  {
41  $redirect = ['some-redirect'];
42  $event = new ‪BeforeRedirectMatchDomainEvent('acme.com', '/some-path', '?param=value', '*');
43 
44  $event->setMatchedRedirect($redirect);
45  self::assertSame($redirect, $event->getMatchedRedirect());
46 
47  $event->setMatchedRedirect(null);
48  self::assertNull($event->getMatchedRedirect());
49  }
50 }
‪TYPO3\CMS\Redirects\Tests\Unit\Event\BeforeRedirectMatchDomainEventTest\matchedRedirectSetterReturnsSetMatchedRedirectAndCanBeSetToNull
‪matchedRedirectSetterReturnsSetMatchedRedirectAndCanBeSetToNull()
Definition: BeforeRedirectMatchDomainEventTest.php:39
‪TYPO3\CMS\Redirects\Tests\Unit\Event\BeforeRedirectMatchDomainEventTest
Definition: BeforeRedirectMatchDomainEventTest.php:25
‪TYPO3\CMS\Redirects\Tests\Unit\Event
Definition: AfterAutoCreateRedirectHasBeenPersistedEventTest.php:18
‪TYPO3\CMS\Redirects\Tests\Unit\Event\BeforeRedirectMatchDomainEventTest\getterReturnsConstructorSetValues
‪getterReturnsConstructorSetValues()
Definition: BeforeRedirectMatchDomainEventTest.php:27
‪TYPO3\CMS\Redirects\Event\BeforeRedirectMatchDomainEvent
Definition: BeforeRedirectMatchDomainEvent.php:28