Skip to content

Commit 2701e93

Browse files
authored
Merge pull request #29 from networkteam/fix-unit-tests
Fix unit tests
2 parents 12122fb + 4f1c7ed commit 2701e93

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Tests/Unit/Fusion/ConvertEmailLinksImplementationTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,30 +86,34 @@ public function emailsAreConverted($rawText, $expectedText)
8686

8787
public function emailTexts(): array
8888
{
89+
90+
$htmlEncodedDecryptionString = htmlspecialchars('javascript:linkTo_UnCryptMailto(\'ithiOtmpbeat-rdb\', -15)');
91+
$htmlEncodedSecondDecryptionString = htmlspecialchars('javascript:linkTo_UnCryptMailto(\'uddqpgOtmpbeat-rdb\', -15)');
92+
8993
return [
9094
'just some text not to touch' => [
9195
' this Is some string with line' . chr(10) . ' breaks, special chärß and leading/trailing space ',
9296
' this Is some string with line' . chr(10) . ' breaks, special chärß and leading/trailing space '
9397
],
9498
'single mail link in text' => [
9599
'Email <a href="mailto:[email protected]">[email protected]</a>',
96-
'Email <a href="javascript:linkTo_UnCryptMailto(\'ithiOtmpbeat-rdb\', -15)">test (at) example.com</a>'
100+
'Email <a href="' . $htmlEncodedDecryptionString . '">test (at) example.com</a>'
97101
],
98102
'multiple mail links in text' => [
99103
'Email <a href="mailto:[email protected]">[email protected]</a> and afterwards another email <a href="mailto:[email protected]">[email protected]</a>',
100-
'Email <a href="javascript:linkTo_UnCryptMailto(\'ithiOtmpbeat-rdb\', -15)">test (at) example.com</a> and afterwards another email <a href="javascript:linkTo_UnCryptMailto(\'uddqpgOtmpbeat-rdb\', -15)">foobar (at) example.com</a>'
104+
'Email <a href="' . $htmlEncodedDecryptionString . '">test (at) example.com</a> and afterwards another email <a href="' . $htmlEncodedSecondDecryptionString . '">foobar (at) example.com</a>'
101105
],
102106
'email address outside of link' => [
103107
'Email [email protected] should not be replaced',
104108
'Email [email protected] should not be replaced'
105109
],
106110
'email address with space at the beginning' => [
107111
'Email <a href="mailto: [email protected]">[email protected]</a>',
108-
'Email <a href="javascript:linkTo_UnCryptMailto(\'ithiOtmpbeat-rdb\', -15)">test (at) example.com</a>'
112+
'Email <a href="' . $htmlEncodedDecryptionString . '">test (at) example.com</a>'
109113
],
110114
'email address with attributes after href' => [
111115
'Email <a href="mailto: [email protected]" itemprop="email">[email protected]</a>',
112-
'Email <a href="javascript:linkTo_UnCryptMailto(\'ithiOtmpbeat-rdb\', -15)" itemprop="email">test (at) example.com</a>'
116+
'Email <a href="' . $htmlEncodedDecryptionString . '" itemprop="email">test (at) example.com</a>'
113117
]
114118
];
115119
}

0 commit comments

Comments
 (0)