‪TYPO3CMS  11.5
EmailLinkHandlerTest.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 
21 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
22 
23 class ‪EmailLinkHandlerTest extends UnitTestCase
24 {
29  {
30  return [
31  'email without protocol' => [
32  [
33  'email' => 'one@example.com',
34  ],
35  [
36  'email' => 'one@example.com',
37  ],
38  'mailto:one@example.com',
39  ],
40  'email with protocol' => [
41  [
42  'email' => 'mailto:one@example.com',
43  ],
44  [
45  'email' => 'one@example.com',
46  ],
47  'mailto:one@example.com',
48  ],
49  'email with protocol 2' => [
50  [
51  'email' => 'mailto:info@example.org',
52  ],
53  [
54  'email' => 'info@example.org',
55  ],
56  'mailto:info@example.org',
57  ],
58  ];
59  }
60 
71  public function ‪resolveReturnsSplitParameters($input, $expected, $finalString): void
72  {
73  $subject = new ‪EmailLinkHandler();
74  self::assertEquals($expected, $subject->resolveHandlerData($input));
75  }
76 
87  public function ‪splitParametersToUnifiedIdentifier($input, $parameters, $expected): void
88  {
89  $subject = new ‪EmailLinkHandler();
90  self::assertEquals($expected, $subject->asString($parameters));
91  }
92 }