‪TYPO3CMS  10.4
EmailLinkHandlerTest.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
19 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
20 
21 class ‪EmailLinkHandlerTest extends UnitTestCase
22 {
23 
30  {
31  return [
32  'email without protocol' => [
33  [
34  'email' => 'one@example.com'
35  ],
36  [
37  'email' => 'one@example.com'
38  ],
39  'mailto:one@example.com'
40  ],
41  'email with protocol' => [
42  [
43  'email' => 'mailto:one@example.com'
44  ],
45  [
46  'email' => 'one@example.com'
47  ],
48  'mailto:one@example.com'
49  ],
50  'email with protocol 2' => [
51  [
52  'email' => 'mailto:info@example.org'
53  ],
54  [
55  'email' => 'info@example.org'
56  ],
57  'mailto:info@example.org'
58  ],
59  ];
60  }
61 
71  public function ‪resolveReturnsSplitParameters($input, $expected, $finalString)
72  {
73  $subject = new ‪EmailLinkHandler();
74  self::assertEquals($expected, $subject->resolveHandlerData($input));
75  }
76 
86  public function ‪splitParametersToUnifiedIdentifier($input, $parameters, $expected)
87  {
88  $subject = new ‪EmailLinkHandler();
89  self::assertEquals($expected, $subject->asString($parameters));
90  }
91 }