forked from php/web-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclean-anti-spam.phpt
53 lines (48 loc) · 1.23 KB
/
clean-anti-spam.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
--TEST--
clean_AntiSPAM() removes spam terms
--FILE--
<?php
require_once __DIR__ . '/../include/email-validation.inc';
$emails = array (
'wrong-address-with@@@@-remove_me-and-some-i-hate_SPAM-stuff',
);
$cleanedEmails = array_map(static function (string $email): string {
return clean_AntiSPAM($email);
}, $emails);
var_dump($cleanedEmails);
?>
--EXPECT--
array(11) {
[0]=>
string(21) "[email protected]"
[1]=>
string(22) "[email protected]"
[2]=>
string(22) "[email protected]"
[3]=>
string(22) "[email protected]"
[4]=>
string(22) "[email protected]"
[5]=>
string(19) "[email protected]"
[6]=>
string(23) "[email protected]"
[7]=>
string(23) "[email protected]"
[8]=>
string(20) "[email protected]"
[9]=>
string(35) "wrong-address-with@@@@and-somestuff"
[10]=>
string(33) "[email protected]"
}