‪TYPO3CMS  9.5
EmailLinkHandlerTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
18 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
19 
20 class ‪EmailLinkHandlerTest extends UnitTestCase
21 {
22 
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 
70  public function ‪resolveReturnsSplitParameters($input, $expected, $finalString)
71  {
72  $subject = new ‪EmailLinkHandler();
73  $this->assertEquals($expected, $subject->resolveHandlerData($input));
74  }
75 
85  public function ‪splitParametersToUnifiedIdentifier($input, $parameters, $expected)
86  {
87  $subject = new ‪EmailLinkHandler();
88  $this->assertEquals($expected, $subject->asString($parameters));
89  }
90 }