|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Copyright (c) 2014-2016 Ryan Parman. |
|
4
|
|
|
* |
|
5
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy |
|
6
|
|
|
* of this software and associated documentation files (the "Software"), to deal |
|
7
|
|
|
* in the Software without restriction, including without limitation the rights |
|
8
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
9
|
|
|
* copies of the Software, and to permit persons to whom the Software is |
|
10
|
|
|
* furnished to do so, subject to the following conditions: |
|
11
|
|
|
* |
|
12
|
|
|
* The above copyright notice and this permission notice shall be included in |
|
13
|
|
|
* all copies or substantial portions of the Software. |
|
14
|
|
|
* |
|
15
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
16
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
17
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
18
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
19
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
20
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
21
|
|
|
* THE SOFTWARE. |
|
22
|
|
|
* |
|
23
|
|
|
* http://opensource.org/licenses/MIT |
|
24
|
|
|
*/ |
|
25
|
|
|
|
|
26
|
|
|
namespace Skyzyx\Tests\StrongTypes\StringType; |
|
27
|
|
|
|
|
28
|
|
|
use Skyzyx\StrongTypes\StringType\Email; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @see http://codefool.tumblr.com/post/15288874550/list-of-valid-and-invalid-email-addresses |
|
32
|
|
|
* @see https://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/EmailTest.java?view=markup |
|
|
|
|
|
|
33
|
|
|
*/ |
|
34
|
|
|
class EmailInvalidTest extends \PHPUnit_Framework_TestCase |
|
35
|
|
|
{ |
|
36
|
|
|
public function listEmails() |
|
37
|
|
|
{ |
|
38
|
|
|
return [ |
|
39
|
|
|
[" Just a string"], |
|
|
|
|
|
|
40
|
|
|
[" [email protected]"], |
|
|
|
|
|
|
41
|
|
|
[" [email protected]"], |
|
|
|
|
|
|
42
|
|
|
["$@[]"], |
|
|
|
|
|
|
43
|
|
|
["':;"], |
|
44
|
|
|
["()@example.com"], |
|
|
|
|
|
|
45
|
|
|
["(comment)"], |
|
|
|
|
|
|
46
|
|
|
["(foo) [email protected]"], |
|
|
|
|
|
|
47
|
|
|
["*()@[]"], |
|
|
|
|
|
|
48
|
|
|
["@example.com"], |
|
|
|
|
|
|
49
|
|
|
["\"127.0.0.1\"@[127.0.0.1]"], |
|
|
|
|
|
|
50
|
|
|
["\":sysmail\"@ Some-Group. Some-Org"], |
|
|
|
|
|
|
51
|
|
|
["\"\"test\\\"\"blah\"\"@example.com"], |
|
|
|
|
|
|
52
|
|
|
["\"\\\"\"@foo.bar"], |
|
|
|
|
|
|
53
|
|
|
["\"Abi\"gail\" <[email protected]>"], |
|
|
|
|
|
|
54
|
|
|
["\"Abi\\\"gail\" <[email protected]>"], |
|
|
|
|
|
|
55
|
|
|
["\"Abigail \"<[email protected]>"], |
|
|
|
|
|
|
56
|
|
|
["\"George, Ted\" <[email protected]>"], |
|
|
|
|
|
|
57
|
|
|
["\"Joe & J. Harvey\" <example @Org>"], |
|
|
|
|
|
|
58
|
|
|
["\"Joe & J. Harvey\"\\x0D\\x0A <ddd\\@ Org>"], |
|
59
|
|
|
["\"Joe &\\x0D\\x0A J. Harvey\" <ddd \\@ Org>"], |
|
60
|
|
|
["\"joe!\"@apache.org"], |
|
|
|
|
|
|
61
|
|
|
["\"joe%45\"@apache.org"], |
|
|
|
|
|
|
62
|
|
|
["\"joe&\"@apache.org"], |
|
|
|
|
|
|
63
|
|
|
["\"joe'\"@apache.org"], |
|
64
|
|
|
["\"joe(\"@apache.org"], |
|
|
|
|
|
|
65
|
|
|
["\"joe)\"@apache.org"], |
|
|
|
|
|
|
66
|
|
|
["\"joe*\"@apache.org"], |
|
|
|
|
|
|
67
|
|
|
["\"joe+\"@apache.org"], |
|
|
|
|
|
|
68
|
|
|
["\"joe,\"@apache.org"], |
|
|
|
|
|
|
69
|
|
|
["\"joe.\"@apache.org"], |
|
|
|
|
|
|
70
|
|
|
["\"joe;\"@apache.org"], |
|
|
|
|
|
|
71
|
|
|
["\"joe=\"@apache.org"], |
|
|
|
|
|
|
72
|
|
|
["\"joe?\"@apache.org"], |
|
|
|
|
|
|
73
|
|
|
["\"quoted ( brackets\" ( a comment )@example.com"], |
|
|
|
|
|
|
74
|
|
|
["\"test\\\rblah\"@example.com"], |
|
75
|
|
|
["\"test\rblah\"@example.com"], |
|
76
|
|
|
["\"This is a phrase\"<[email protected]>"], |
|
|
|
|
|
|
77
|
|
|
["Abigail (foo) (((baz)(nested) (comment)) ! ) < (one) abigail (two) @(three)example . (bar) com (quz) >"], |
|
|
|
|
|
|
78
|
|
|
["Abigail < (one) abigail (two) @(three)example . (bar) com (quz) >"], |
|
|
|
|
|
|
79
|
|
|
["Abigail <abi gail @ example.com>"], |
|
|
|
|
|
|
80
|
|
|
["Abigail <abigail @ example . (bar) com >"], |
|
|
|
|
|
|
81
|
|
|
["Abigail <abigail @ example.com>"], |
|
|
|
|
|
|
82
|
|
|
["Abigail <abigail(fo(o)@example.com>"], |
|
|
|
|
|
|
83
|
|
|
["Abigail <abigail(fo)o)@example.com>"], |
|
|
|
|
|
|
84
|
|
|
["Abigail <abigail(fo\\(o)@example.com>"], |
|
|
|
|
|
|
85
|
|
|
["Abigail <abigail(fo\\)o)@example.com> "], |
|
|
|
|
|
|
86
|
|
|
["Abigail <[email protected]>"], |
|
|
|
|
|
|
87
|
|
|
["abigail @example.com "], |
|
|
|
|
|
|
88
|
|
|
["Abigail made this < abigail @ example . com >"], |
|
|
|
|
|
|
89
|
|
|
["Abigail(the bitch)@example.com"], |
|
|
|
|
|
|
90
|
|
|
["Abigail<@a,@b,@c:[email protected]>"], |
|
|
|
|
|
|
91
|
|
|
["Abigail<[email protected]>"], |
|
|
|
|
|
|
92
|
|
|
["abigail@"], |
|
|
|
|
|
|
93
|
|
|
["abigail@[exa[ple.com]"], |
|
|
|
|
|
|
94
|
|
|
["abigail@[exa\\[ple.com]"], |
|
|
|
|
|
|
95
|
|
|
["abigail@[exa\\]ple.com]"], |
|
|
|
|
|
|
96
|
|
|
["abigail@[exa]ple.com]"], |
|
|
|
|
|
|
97
|
|
|
["abigail@[example.com]"], |
|
|
|
|
|
|
98
|
|
|
["abigail@[exaple].com]"], |
|
|
|
|
|
|
99
|
|
|
["[email protected] "], |
|
|
|
|
|
|
100
|
|
|
["[email protected] (foo)"], |
|
|
|
|
|
|
101
|
|
|
["Alfred Neuman <Neuman@BBN-TENEXA>"], |
|
|
|
|
|
|
102
|
|
|
["[email protected]"], |
|
|
|
|
|
|
103
|
|
|
["andy.noble@\u008fdata-workshop.com"], |
|
104
|
|
|
["[email protected]."], |
|
|
|
|
|
|
105
|
|
|
["andy@o'reilly.data-workshop.com"], |
|
106
|
|
|
["Cruisers: Port@Portugal, Jones@SEA;"], |
|
|
|
|
|
|
107
|
|
|
["fred(&)[email protected]"], |
|
|
|
|
|
|
108
|
|
|
["fred\\ [email protected]"], |
|
|
|
|
|
|
109
|
|
|
["invalid�[email protected]"], |
|
|
|
|
|
|
110
|
|
|
["joe [email protected] "], |
|
|
|
|
|
|
111
|
|
|
["joe(@apache.org"], |
|
|
|
|
|
|
112
|
|
|
["joe)@apache.org"], |
|
|
|
|
|
|
113
|
|
|
["joe,@apache.org"], |
|
|
|
|
|
|
114
|
|
|
["[email protected]"], |
|
|
|
|
|
|
115
|
|
|
["joe;@apache.org"], |
|
|
|
|
|
|
116
|
|
|
["joe@localhost"], |
|
|
|
|
|
|
117
|
|
|
["[email protected]"], |
|
|
|
|
|
|
118
|
|
|
["joeblow @apache.org"], |
|
|
|
|
|
|
119
|
|
|
["joeblow@ apache.org"], |
|
|
|
|
|
|
120
|
|
|
["joeblow@apa che.org "], |
|
|
|
|
|
|
121
|
|
|
["joeblow@apa,che.org"], |
|
|
|
|
|
|
122
|
|
|
["joeblow@apache,org"], |
|
|
|
|
|
|
123
|
|
|
["[email protected],rg"], |
|
|
|
|
|
|
124
|
|
|
["[email protected] "], |
|
|
|
|
|
|
125
|
|
|
["jsmith@apache."], |
|
|
|
|
|
|
126
|
|
|
["m@de"], |
|
|
|
|
|
|
127
|
|
|
["mailbox.sub1.sub2@this-domain"], |
|
|
|
|
|
|
128
|
|
|
["Muhammed.(I am the greatest) Ali @(the)Vegas.WBA"], |
|
|
|
|
|
|
129
|
|
|
["name: ;"], |
|
|
|
|
|
|
130
|
|
|
["name:;"], |
|
|
|
|
|
|
131
|
|
|
["Neuman@BBN-TENEXA"], |
|
|
|
|
|
|
132
|
|
|
["phrase: [email protected] [email protected] ;"], |
|
|
|
|
|
|
133
|
|
|
["someone@[216.109.118.76]"], |
|
|
|
|
|
|
134
|
|
|
["string"], |
|
|
|
|
|
|
135
|
|
|
["Wilt . (the Stilt) [email protected]"], |
|
|
|
|
|
|
136
|
|
|
[' ( x ) first ( x ) . ( x) last ( x ) @iana.org'], |
|
|
|
|
|
|
137
|
|
|
['"""@iana.org'], |
|
138
|
|
|
['""@iana.org'], |
|
139
|
|
|
['""Austin@Powers""@example.com'], |
|
140
|
|
|
['""Ima Fool""@example.com'], |
|
141
|
|
|
['""Ima.Fool""@example.com'], |
|
142
|
|
|
['""test""blah""@example.com'], |
|
143
|
|
|
['""test\\blah""@example.com'], |
|
144
|
|
|
['""test\blah""@example.com'], |
|
145
|
|
|
['"(),:;<>[\]@example.com'], |
|
146
|
|
|
['"[[ test ]]"@iana.org'], |
|
147
|
|
|
['"\"@iana.org'], |
|
148
|
|
|
['"Abc@def"@example.com'], |
|
149
|
|
|
['"Abc@def"@iana.org'], |
|
150
|
|
|
['"Abc\@def"@example.com'], |
|
151
|
|
|
['"Abc\@def"@iana.org'], |
|
152
|
|
|
['"Austin@Powers"@iana.org'], |
|
153
|
|
|
['"Doug "Ace" L."@iana.org'], |
|
154
|
|
|
['"Doug \"Ace\" L."@iana.org'], |
|
155
|
|
|
['"email"@example.com'], |
|
156
|
|
|
['"first"."last"@iana.org'], |
|
157
|
|
|
['"first"."middle"."last"@iana.org'], |
|
158
|
|
|
['"first"[email protected]'], |
|
159
|
|
|
['"first".middle."last"@iana.org'], |
|
160
|
|
|
['"first"last"@iana.org'], |
|
161
|
|
|
['"first(last)"@iana.org'], |
|
162
|
|
|
['"first..last"@iana.org'], |
|
163
|
|
|
['"first.middle"."last"@iana.org'], |
|
164
|
|
|
['"first.middle.last"@iana.org'], |
|
165
|
|
|
['"first@last"@iana.org'], |
|
166
|
|
|
['"first\"last"@iana.org'], |
|
167
|
|
|
['"first\\"last"@iana.org'], |
|
168
|
|
|
['"first\\\"last"@iana.org'], |
|
169
|
|
|
['"first\\last"@iana.org'], |
|
170
|
|
|
['"first\last"@iana.org'], |
|
171
|
|
|
['"foo"(yay)@(hoopla)[1.2.3.4]'], |
|
172
|
|
|
['"Fred Bloggs"@example.com'], |
|
173
|
|
|
['"Fred Bloggs"@iana.org'], |
|
174
|
|
|
['"Fred\ Bloggs"@iana.org'], |
|
175
|
|
|
['"hello my name is"@stutter.com'], |
|
176
|
|
|
['"Ima Fool"@iana.org'], |
|
177
|
|
|
['"Ima.Fool"@iana.org'], |
|
178
|
|
|
['"Joe.\\Blow"@iana.org'], |
|
179
|
|
|
['"Joe\\Blow"@example.com'], |
|
180
|
|
|
['"Joe\\Blow"@iana.org'], |
|
181
|
|
|
['"[email protected]'], |
|
182
|
|
|
['"Test \"Fail\" Ing"@iana.org'], |
|
183
|
|
|
['"test"blah"@iana.org'], |
|
184
|
|
|
['"test"test"@iana.org'], |
|
185
|
|
|
['"test blah"@iana.org'], |
|
186
|
|
|
['"test blah"@iana.org'], |
|
187
|
|
|
['"test.test"@iana.org'], |
|
188
|
|
|
['"test@test"@iana.org'], |
|
189
|
|
|
['"test\"blah"@iana.org'], |
|
190
|
|
|
['"test\ blah"@iana.org'], |
|
191
|
|
|
['"test\ blah"@iana.org'], |
|
192
|
|
|
['"test\\blah"@iana.org'], |
|
193
|
|
|
['"test\blah"@iana.org'], |
|
194
|
|
|
['"test\test"@iana.org'], |
|
195
|
|
|
['"Unicode NULL \␀"@char.com'], |
|
196
|
|
|
['"Unicode NULL ␀"@char.com'], |
|
197
|
|
|
['#@%^%#$@#$@#.com'], |
|
198
|
|
|
['()[]\;:,><@iana.org'], |
|
199
|
|
|
['(foo)cal(bar)@(baz)iamcal.com(quux)'], |
|
200
|
|
|
['-- test [email protected]'], |
|
201
|
|
|
['[email protected]'], |
|
202
|
|
|
['[email protected]'], |
|
203
|
|
|
['.@'], |
|
204
|
|
|
['[email protected]'], |
|
205
|
|
|
['[email protected]'], |
|
206
|
|
|
['[email protected]'], |
|
207
|
|
|
['[email protected]'], |
|
208
|
|
|
['[email protected]'], |
|
209
|
|
|
['[email protected]'], |
|
210
|
|
|
['[email protected]'], |
|
211
|
|
|
['[email protected]'], |
|
212
|
|
|
['1234 @ local(blah) .machine .example'], |
|
213
|
|
|
['12345678901234567890123456789012345678901234567890123456789012345@iana.org'], |
|
214
|
|
|
['1234567890123456789012345678901234567890123456789012345678901234@iana.org'], |
|
215
|
|
|
['123456789012345678901234567890123456789012345678901234567890@12345678901234567890123456789012345678901234567890123456789.12345678901234567890123456789012345678901234567890123456789.12345678901234567890123456789012345678901234567890123456789.12345.iana.org'], |
|
|
|
|
|
|
216
|
|
|
['1234567890123456789012345678901234567890123456789012345678@12345678901234567890123456789012345678901234567890123456789.12345678901234567890123456789012345678901234567890123456789.123456789012345678901234567890123456789012345678901234567890123.iana.org'], |
|
|
|
|
|
|
217
|
|
|
['@@bar.com'], |
|
218
|
|
|
['@bar.com'], |
|
219
|
|
|
['@example.com'], |
|
220
|
|
|
['@iana.org'], |
|
221
|
|
|
['@NotAnEmail'], |
|
222
|
|
|
['[test]@iana.org'], |
|
223
|
|
|
['a(a(b(c)d(e(f))g)(h(i)j)@iana.org'], |
|
224
|
|
|
['a(a(b(c)d(e(f))g)h(i)j)@iana.org'], |
|
225
|
|
|
['[email protected]'], |
|
226
|
|
|
['a@b'], |
|
227
|
|
|
['[email protected]'], |
|
228
|
|
|
['a@bar'], |
|
229
|
|
|
['[email protected].'], |
|
230
|
|
|
['aaa.com'], |
|
231
|
|
|
['[email protected]'], |
|
232
|
|
|
['[email protected]'], |
|
233
|
|
|
['aaa@[123.123.123.123]'], |
|
234
|
|
|
['aaa@[123.123.123.123]a'], |
|
235
|
|
|
['aaa@[123.123.123.333]'], |
|
236
|
|
|
['[email protected]'], |
|
237
|
|
|
['abc@[email protected]'], |
|
238
|
|
|
['abc\@[email protected]'], |
|
239
|
|
|
['Abc\@[email protected]'], |
|
240
|
|
|
['abc\@iana.org'], |
|
241
|
|
|
['abc\\@[email protected]'], |
|
242
|
|
|
['abc\\@iana.org'], |
|
243
|
|
|
['c@(Chris\'s host.)public.example'], |
|
244
|
|
|
['cal(foo(bar)@iamcal.com'], |
|
245
|
|
|
['cal(foo)bar)@iamcal.com'], |
|
246
|
|
|
['cal(foo\)@iamcal.com'], |
|
247
|
|
|
['cal(foo\)bar)@iamcal.com'], |
|
248
|
|
|
['cal(foo\@bar)@iamcal.com'], |
|
249
|
|
|
['cal(woo(yay)hoopla)@iamcal.com'], |
|
250
|
|
|
['cal@iamcal(woo).(yay)com'], |
|
251
|
|
|
['cdburgess+!#$%&\'*-/=?+_{}|[email protected]'], |
|
252
|
|
|
['customer/[email protected]'], |
|
253
|
|
|
['customer/[email protected]'], |
|
254
|
|
|
['[email protected]'], |
|
255
|
|
|
['doug@'], |
|
256
|
|
|
['Doug\ \"Ace\"\ L\[email protected]'], |
|
257
|
|
|
['Doug\ \"Ace\"\ [email protected]'], |
|
258
|
|
|
['[email protected]'], |
|
259
|
|
|
['[email protected]'], |
|
260
|
|
|
['email.example.com'], |
|
261
|
|
|
['[email protected]'], |
|
262
|
|
|
['[email protected]'], |
|
263
|
|
|
['[email protected]'], |
|
264
|
|
|
['email@[123.123.123.123]'], |
|
265
|
|
|
['email@example'], |
|
266
|
|
|
['[email protected]'], |
|
267
|
|
|
['[email protected] (Joe Smith)'], |
|
268
|
|
|
['email@[email protected]'], |
|
269
|
|
|
['first()[email protected]'], |
|
270
|
|
|
['first(12345678901234567890123456789012345678901234567890)last@(1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890)iana.org'], |
|
|
|
|
|
|
271
|
|
|
['first(a"bc.def)[email protected]'], |
|
272
|
|
|
['first(abc("def".ghi).mno)middle(abc("def".ghi).mno).last@(abc("def".ghi).mno)example(abc("def".ghi).mno).(abc("def".ghi).mno)com(abc("def".ghi).mno)'], |
|
|
|
|
|
|
273
|
|
|
['first(abc.def)[email protected]'], |
|
274
|
|
|
['first(abc\(def)@iana.org'], |
|
275
|
|
|
['first(middle)[email protected]'], |
|
276
|
|
|
['first(Welcome to the ("wonderful" (!)) world of email)@iana.org'], |
|
277
|
|
|
['first.""[email protected]'], |
|
278
|
|
|
['first."last"@iana.org'], |
|
279
|
|
|
['first."mid\dle"."last"@iana.org'], |
|
280
|
|
|
['first.(")middle.last(")@iana.org'], |
|
281
|
|
|
['first.( middle )[email protected]'], |
|
282
|
|
|
['[email protected]'], |
|
283
|
|
|
['first.last @iana.org'], |
|
284
|
|
|
['first.last'], |
|
285
|
|
|
['[email protected]'], |
|
286
|
|
|
['first.last@'], |
|
287
|
|
|
['[email protected]'], |
|
288
|
|
|
['first.last@[.12.34.56.78]'], |
|
289
|
|
|
['first.last@[12.34.56.789]'], |
|
290
|
|
|
['first.last@[12.34.56.78]'], |
|
291
|
|
|
['first.last@[::12.34.56.78]'], |
|
292
|
|
|
['first.last@[IPv5:::12.34.56.78]'], |
|
293
|
|
|
['first.last@[IPv6:0123:4567:89ab:cdef::11.22.33.44]'], |
|
294
|
|
|
['first.last@[IPv6:0123:4567:89ab:CDEF::11.22.33.44]'], |
|
295
|
|
|
['first.last@[IPv6:0123:4567:89ab:cdef::11.22.33.xx]'], |
|
296
|
|
|
['first.last@[IPv6:0123:4567:89ab:cdef::]'], |
|
297
|
|
|
['first.last@[IPv6:0123:4567:89ab:CDEF::]'], |
|
298
|
|
|
['first.last@[IPv6:0123:4567:89ab:CDEFF::11.22.33.44]'], |
|
299
|
|
|
['first.last@[IPv6:1111:2222:33333::4444:5555]'], |
|
300
|
|
|
['first.last@[IPv6:1111:2222:3333:4444:5555:12.34.56.78]'], |
|
301
|
|
|
['first.last@[IPv6:1111:2222:3333:4444:5555:6666:12.34.56.78]'], |
|
302
|
|
|
['first.last@[IPv6:1111:2222:3333:4444:5555:6666:12.34.567.89]'], |
|
303
|
|
|
['first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:12.34.56.78]'], |
|
304
|
|
|
['first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:8888:9999]'], |
|
305
|
|
|
['first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777:8888]'], |
|
306
|
|
|
['first.last@[IPv6:1111:2222:3333:4444:5555:6666:7777]'], |
|
307
|
|
|
['first.last@[IPv6:1111:2222:3333:4444:5555:6666::]'], |
|
308
|
|
|
['first.last@[IPv6:1111:2222:3333::4444:12.34.56.78]'], |
|
309
|
|
|
['first.last@[IPv6:1111:2222:3333::4444:5555:12.34.56.78]'], |
|
310
|
|
|
['first.last@[IPv6:1111:2222:3333::4444:5555:6666:7777]'], |
|
311
|
|
|
['first.last@[IPv6:1111:2222:3333::4444:5555:6666]'], |
|
312
|
|
|
['first.last@[IPv6:1111:2222:333x::4444:5555]'], |
|
313
|
|
|
['first.last@[IPv6:1111:2222::3333::4444:5555:6666]'], |
|
314
|
|
|
['first.last@[IPv6::11.22.33.44]'], |
|
315
|
|
|
['first.last@[IPv6:::1111:2222:3333:4444:5555:6666]'], |
|
316
|
|
|
['first.last@[IPv6:::12.34.56.78]'], |
|
317
|
|
|
['first.last@[IPv6::::11.22.33.44]'], |
|
318
|
|
|
['first.last@[IPv6::::]'], |
|
319
|
|
|
['first.last@[IPv6::::b3:b4]'], |
|
320
|
|
|
['first.last@[IPv6::::b4]'], |
|
321
|
|
|
['first.last@[IPv6:::]'], |
|
322
|
|
|
['first.last@[IPv6:::a2:a3:a4:b1:b2:b3:b4]'], |
|
323
|
|
|
['first.last@[IPv6:::a2:a3:a4:b1:ffff:11.22.33.44]'], |
|
324
|
|
|
['first.last@[IPv6:::a3:a4:b1:ffff:11.22.33.44]'], |
|
325
|
|
|
['first.last@[IPv6:::b3:b4]'], |
|
326
|
|
|
['first.last@[IPv6:::b4]'], |
|
327
|
|
|
['first.last@[IPv6::]'], |
|
328
|
|
|
['first.last@[IPv6::a2::b4]'], |
|
329
|
|
|
['first.last@[IPv6::a2:a3:a4:b1:b2:b3:b4]'], |
|
330
|
|
|
['first.last@[IPv6::b3:b4]'], |
|
331
|
|
|
['first.last@[IPv6::b4]'], |
|
332
|
|
|
['first.last@[IPv6:a1:11.22.33.44]'], |
|
333
|
|
|
['first.last@[IPv6:a1::11.22.33.44.55]'], |
|
334
|
|
|
['first.last@[IPv6:a1::11.22.33.44]'], |
|
335
|
|
|
['first.last@[IPv6:a1::11.22.33]'], |
|
336
|
|
|
['first.last@[IPv6:a1:::11.22.33.44]'], |
|
337
|
|
|
['first.last@[IPv6:a1:::]'], |
|
338
|
|
|
['first.last@[IPv6:a1:::b4]'], |
|
339
|
|
|
['first.last@[IPv6:a1::]'], |
|
340
|
|
|
['first.last@[IPv6:a1::a4:b1::b4:11.22.33.44]'], |
|
341
|
|
|
['first.last@[IPv6:a1::b211.22.33.44]'], |
|
342
|
|
|
['first.last@[IPv6:a1::b2:11.22.33.44]'], |
|
343
|
|
|
['first.last@[IPv6:a1::b2::11.22.33.44]'], |
|
344
|
|
|
['first.last@[IPv6:a1::b3:]'], |
|
345
|
|
|
['first.last@[IPv6:a1::b4]'], |
|
346
|
|
|
['first.last@[IPv6:a1:]'], |
|
347
|
|
|
['first.last@[IPv6:a1:a2::11.22.33.44]'], |
|
348
|
|
|
['first.last@[IPv6:a1:a2:::11.22.33.44]'], |
|
349
|
|
|
['first.last@[IPv6:a1:a2:::]'], |
|
350
|
|
|
['first.last@[IPv6:a1:a2::]'], |
|
351
|
|
|
['first.last@[IPv6:a1:a2:]'], |
|
352
|
|
|
['first.last@[IPv6:a1:a2:a3:a4::11.22.33.44]'], |
|
353
|
|
|
['first.last@[IPv6:a1:a2:a3:a4::b1:b2:b3:b4]'], |
|
354
|
|
|
['first.last@[IPv6:a1:a2:a3:a4:b1::11.22.33.44]'], |
|
355
|
|
|
['first.last@[IPv6:a1:a2:a3:a4:b1:b2:b3::]'], |
|
356
|
|
|
['first.last@[IPv6:a1:a2:a3:a4:b1:b2:b3:]'], |
|
357
|
|
|
['first.last@com'], |
|
358
|
|
|
['[email protected]'], |
|
359
|
|
|
['[email protected]'], |
|
360
|
|
|
['[email protected],com'], |
|
361
|
|
|
['first.last@x(1234567890123456789012345678901234567890123456789012345678901234567890).com'], |
|
362
|
|
|
['first.last@x23456789012345678901234567890123456789012345678901234567890123.iana.org'], |
|
363
|
|
|
['first.last@x234567890123456789012345678901234567890123456789012345678901234.iana.org'], |
|
364
|
|
|
['first\@[email protected]'], |
|
365
|
|
|
['first\\@[email protected]'], |
|
366
|
|
|
['first\[email protected]'], |
|
367
|
|
|
['foo@[\1.2.3.4]'], |
|
368
|
|
|
['[email protected]'], |
|
369
|
|
|
['Fred\ [email protected]'], |
|
370
|
|
|
['[email protected].'], |
|
371
|
|
|
['hello [email protected]'], |
|
372
|
|
|
['HM2Kinsists@(that comments are allowed)this.is.ok'], |
|
373
|
|
|
['Ima [email protected]'], |
|
374
|
|
|
['Ima [email protected]'], |
|
375
|
|
|
['Invalid \ Folding \ [email protected]'], |
|
376
|
|
|
['[email protected]'], |
|
377
|
|
|
['jdoe@machine(comment). example'], |
|
378
|
|
|
['Joe Smith <[email protected]>'], |
|
379
|
|
|
['Joe.\\[email protected]'], |
|
380
|
|
|
['just"not"[email protected]'], |
|
381
|
|
|
['much."more\ unusual"@example.com'], |
|
382
|
|
|
['NotAnEmail'], |
|
383
|
|
|
['ote"@iana.org'], |
|
384
|
|
|
['pete(his account)@silly.test(his host)'], |
|
385
|
|
|
['phil.h\@\@[email protected]'], |
|
386
|
|
|
['plainaddress'], |
|
387
|
|
|
['[email protected]'], |
|
388
|
|
|
['[email protected]'], |
|
389
|
|
|
['test. [email protected]'], |
|
390
|
|
|
['test."test"@iana.org'], |
|
391
|
|
|
['Test. Folding. [email protected]'], |
|
392
|
|
|
['test. [email protected]'], |
|
393
|
|
|
['[email protected]'], |
|
394
|
|
|
['[email protected]'], |
|
395
|
|
|
['test.iana.org'], |
|
396
|
|
|
['test@.'], |
|
397
|
|
|
['[email protected]'], |
|
398
|
|
|
['[email protected]'], |
|
399
|
|
|
['[email protected]'], |
|
400
|
|
|
['[email protected]]'], |
|
401
|
|
|
['test@123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012.com'], |
|
|
|
|
|
|
402
|
|
|
['test@@iana.org'], |
|
403
|
|
|
['test@[123.123.123.123'], |
|
404
|
|
|
['test@[123.123.123.123]'], |
|
405
|
|
|
['test@example'], |
|
406
|
|
|
['test@example.'], |
|
407
|
|
|
['[email protected] '], |
|
408
|
|
|
['test@[email protected]'], |
|
409
|
|
|
['this\ is"really"not\[email protected]'], |
|
410
|
|
|
['[email protected]'], |
|
411
|
|
|
['Unicode NULL \␀@char.com'], |
|
412
|
|
|
['very."(),:;<>[]".VERY."very@\\ "very"[email protected]'], |
|
413
|
|
|
['very.unusual."@"[email protected]'], |
|
414
|
|
|
['[email protected]'], |
|
415
|
|
|
['[email protected]'], |
|
416
|
|
|
['x@x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456789.x23456'], |
|
|
|
|
|
|
417
|
|
|
['{^c\@**Dog^}@cartoon.com'], |
|
418
|
|
|
]; |
|
419
|
|
|
} |
|
420
|
|
|
|
|
421
|
|
|
/** |
|
422
|
|
|
* @dataProvider listEmails |
|
423
|
|
|
* @expectedException UnexpectedValueException |
|
424
|
|
|
*/ |
|
425
|
|
|
public function testValidate($email) |
|
426
|
|
|
{ |
|
427
|
|
|
$this->assertTrue(true); |
|
428
|
|
|
new Email($email); |
|
429
|
|
|
} |
|
430
|
|
|
} |
|
431
|
|
|
|
Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.