@@ -2206,115 +2206,6 @@ public function testNaturalNumber()
2206
2206
$ this ->assertTrue (Validation::naturalNumber (0 , true ));
2207
2207
}
2208
2208
2209
- /**
2210
- * testPhone method
2211
- *
2212
- * @return void
2213
- */
2214
- public function testPhone ()
2215
- {
2216
- $ this ->assertFalse (Validation::phone ('teststring ' ));
2217
- $ this ->assertFalse (Validation::phone ('1-(33)-(333)-(4444) ' ));
2218
- $ this ->assertFalse (Validation::phone ('1-(33)-3333-4444 ' ));
2219
- $ this ->assertFalse (Validation::phone ('1-(33)-33-4444 ' ));
2220
- $ this ->assertFalse (Validation::phone ('1-(33)-3-44444 ' ));
2221
- $ this ->assertFalse (Validation::phone ('1-(33)-3-444 ' ));
2222
- $ this ->assertFalse (Validation::phone ('1-(33)-3-44 ' ));
2223
-
2224
- $ this ->assertFalse (Validation::phone ('(055) 999-9999 ' ));
2225
- $ this ->assertFalse (Validation::phone ('(155) 999-9999 ' ));
2226
- $ this ->assertFalse (Validation::phone ('(595) 999-9999 ' ));
2227
- $ this ->assertFalse (Validation::phone ('(213) 099-9999 ' ));
2228
- $ this ->assertFalse (Validation::phone ('(213) 199-9999 ' ));
2229
-
2230
- // invalid area-codes
2231
- $ this ->assertFalse (Validation::phone ('1-(511)-999-9999 ' ));
2232
- $ this ->assertFalse (Validation::phone ('1-(555)-999-9999 ' ));
2233
-
2234
- // invalid exhange
2235
- $ this ->assertFalse (Validation::phone ('1-(222)-511-9999 ' ));
2236
-
2237
- // invalid phone number
2238
- $ this ->assertFalse (Validation::phone ('1-(222)-555-0199 ' ));
2239
- $ this ->assertFalse (Validation::phone ('1-(222)-555-0122 ' ));
2240
-
2241
- // valid phone numbers
2242
- $ this ->assertTrue (Validation::phone ('416-428-1234 ' ));
2243
- $ this ->assertTrue (Validation::phone ('1-(369)-333-4444 ' ));
2244
- $ this ->assertTrue (Validation::phone ('1-(973)-333-4444 ' ));
2245
- $ this ->assertTrue (Validation::phone ('1-(313)-555-9999 ' ));
2246
- $ this ->assertTrue (Validation::phone ('1-(222)-555-0299 ' ));
2247
- $ this ->assertTrue (Validation::phone ('508-428-1234 ' ));
2248
- $ this ->assertTrue (Validation::phone ('1-(508)-232-9651 ' ));
2249
-
2250
- $ this ->assertTrue (Validation::phone ('1 (222) 333 4444 ' ));
2251
- $ this ->assertTrue (Validation::phone ('+1 (222) 333 4444 ' ));
2252
- $ this ->assertTrue (Validation::phone ('(222) 333 4444 ' ));
2253
-
2254
- $ this ->assertTrue (Validation::phone ('1-(333)-333-4444 ' ));
2255
- $ this ->assertTrue (Validation::phone ('1.(333)-333-4444 ' ));
2256
- $ this ->assertTrue (Validation::phone ('1.(333).333-4444 ' ));
2257
- $ this ->assertTrue (Validation::phone ('1.(333).333.4444 ' ));
2258
- $ this ->assertTrue (Validation::phone ('1-333-333-4444 ' ));
2259
- }
2260
-
2261
- /**
2262
- * testPostal method
2263
- *
2264
- * @return void
2265
- */
2266
- public function testPostal ()
2267
- {
2268
- $ this ->assertFalse (Validation::postal ('111 ' , null , 'de ' ));
2269
- $ this ->assertFalse (Validation::postal ('1111 ' , null , 'de ' ));
2270
- $ this ->assertTrue (Validation::postal ('13089 ' , null , 'de ' ));
2271
-
2272
- $ this ->assertFalse (Validation::postal ('111 ' , null , 'be ' ));
2273
- $ this ->assertFalse (Validation::postal ('0123 ' , null , 'be ' ));
2274
- $ this ->assertTrue (Validation::postal ('1204 ' , null , 'be ' ));
2275
-
2276
- $ this ->assertFalse (Validation::postal ('111 ' , null , 'it ' ));
2277
- $ this ->assertFalse (Validation::postal ('1111 ' , null , 'it ' ));
2278
- $ this ->assertTrue (Validation::postal ('13089 ' , null , 'it ' ));
2279
-
2280
- $ this ->assertFalse (Validation::postal ('111 ' , null , 'uk ' ));
2281
- $ this ->assertFalse (Validation::postal ('1111 ' , null , 'uk ' ));
2282
- $ this ->assertFalse (Validation::postal ('AZA 0AB ' , null , 'uk ' ));
2283
- $ this ->assertFalse (Validation::postal ('X0A 0ABC ' , null , 'uk ' ));
2284
- $ this ->assertTrue (Validation::postal ('X0A 0AB ' , null , 'uk ' ));
2285
- $ this ->assertTrue (Validation::postal ('AZ0A 0AA ' , null , 'uk ' ));
2286
- $ this ->assertTrue (Validation::postal ('A89 2DD ' , null , 'uk ' ));
2287
-
2288
- $ this ->assertFalse (Validation::postal ('111 ' , null , 'ca ' ));
2289
- $ this ->assertFalse (Validation::postal ('1111 ' , null , 'ca ' ));
2290
- $ this ->assertFalse (Validation::postal ('D2A 0A0 ' , null , 'ca ' ));
2291
- $ this ->assertFalse (Validation::postal ('BAA 0ABC ' , null , 'ca ' ));
2292
- $ this ->assertFalse (Validation::postal ('B2A AABC ' , null , 'ca ' ));
2293
- $ this ->assertFalse (Validation::postal ('B2A 2AB ' , null , 'ca ' ));
2294
- $ this ->assertFalse (Validation::postal ('K1A 1D1 ' , null , 'ca ' ));
2295
- $ this ->assertFalse (Validation::postal ('K1O 1Q1 ' , null , 'ca ' ));
2296
- $ this ->assertFalse (Validation::postal ('A1A 1U1 ' , null , 'ca ' ));
2297
- $ this ->assertFalse (Validation::postal ('A1F 1B1 ' , null , 'ca ' ));
2298
- $ this ->assertTrue (Validation::postal ('X0A 0A2 ' , null , 'ca ' ));
2299
- $ this ->assertTrue (Validation::postal ('G4V 4C3 ' , null , 'ca ' ));
2300
-
2301
- $ this ->assertFalse (Validation::postal ('111 ' , null , 'us ' ));
2302
- $ this ->assertFalse (Validation::postal ('1111 ' , null , 'us ' ));
2303
- $ this ->assertFalse (Validation::postal ('130896 ' , null , 'us ' ));
2304
- $ this ->assertFalse (Validation::postal ('13089-33333 ' , null , 'us ' ));
2305
- $ this ->assertFalse (Validation::postal ('13089-333 ' , null , 'us ' ));
2306
- $ this ->assertFalse (Validation::postal ('13A89-4333 ' , null , 'us ' ));
2307
- $ this ->assertTrue (Validation::postal ('13089-3333 ' , null , 'us ' ));
2308
-
2309
- $ this ->assertFalse (Validation::postal ('111 ' ));
2310
- $ this ->assertFalse (Validation::postal ('1111 ' ));
2311
- $ this ->assertFalse (Validation::postal ('130896 ' ));
2312
- $ this ->assertFalse (Validation::postal ('13089-33333 ' ));
2313
- $ this ->assertFalse (Validation::postal ('13089-333 ' ));
2314
- $ this ->assertFalse (Validation::postal ('13A89-4333 ' ));
2315
- $ this ->assertTrue (Validation::postal ('13089-3333 ' ));
2316
- }
2317
-
2318
2209
/**
2319
2210
* testUserDefined method
2320
2211
*
0 commit comments