Odyssey
HandleMIRTest.php
1 <?php
2 use PHPUnit\Framework\TestCase;
3 static $bankingDir = "/var/www/html/shared/library";
4 require_once("$bankingDir/hcuMIRhandler.i");
5 require_once("$bankingDir/hcuCommon.i");
6 require_once("$bankingDir/hcuFunctions.i");
7 
8 class MirTest extends TestCase
9 {
10 
11  /**
12  * @dataProvider rePhoneProvider
13  */
14  public function test_rePhone($phone, $expected)
15  {
16  $this->assertSame($expected, Match_Phone_Regex($phone));
17  }
18  /**
19  * @dataProvider DateProvider
20  */
21  public function test_DateFmt($datechk, $datefmt, $mindate, $maxdate, $expected)
22  {
23  $this->assertSame($expected, Date_In_Range($datechk, $datefmt, $mindate, $maxdate));
24  }
25  /**
26  * @dataProvider PhoneProvider
27  */
28  // test_ in name is important to make test run
29  public function test_PhoneFormat($MIR, $Ml, $reqMIR, $phones, $examine, $expected)
30  {
31  //FormatMIR($MIR, $Ml, $reqMIR, $datefmt = 'Y-m-d', $phones = 'flat', $noEmpty = false, $BizFNdot = false)
32  $cleanMIR = FormatMIR($MIR, $Ml, $reqMIR, 'Y-m-d', $phones, false, false);
33 
34  $this->assertEquals($expected, $cleanMIR['data'][$examine]);
35  }
36  /**
37  * @dataProvider MIRProvider
38  */
39  // test_ in name is important to make test run
40  public function test_MIRData($MIR, $Ml, $reqMIR, $datefmt, $phones, $noEmpty, $BizFNdot, $examine, $expected)
41  {
42  //FormatMIR($MIR, $Ml, $reqMIR, $datefmt = 'Y-m-d', $phones = 'flat', $noEmpty = false, $BizFNdot = false)
43  $cleanMIR = FormatMIR($MIR, $Ml, $reqMIR, $datefmt, $phones, $noEmpty, $BizFNdot);
44 
45  $this->assertSame($expected, $cleanMIR['data'][$examine]);
46  }
47 
48  public function rePhoneProvider()
49  {
50  // (phone_to_check, expected_result)
51  return [
52  'area_contains_0' => ['208-841-2873', true],
53  'happy_path' => ['5418412873', true],
54  'seven_zeros' => ['0000000',false],
55  'ten_zeros' => ['0000000000',false],
56  'punctuated' => ['(208) 841-2873', true],
57  'split' => ['541-841-2873',true],
58  'split_short' => ['841-2873',false],
59  'flat_short' => ['8412873',false],
60  'spaces_ten' => ['223 456 7890',true],
61  'parens_space_10' => ['(223) 345-5555',true],
62  'parens_nospace_10' => ['(323)344-4444',true],
63  'split_10' =>['333-333-3333',true],
64  'flat_ten' => ['2234567890',true],
65  'not7or10' => ['123456',false],
66  'long' => ['20814211525', false],
67  'alphanum' => ['503-ja5-2988',false]
68  ];
69  }
70  public function DateProvider()
71  {
72  date_default_timezone_set('UTC');
73  $nextyear = date('m-d-Y', strtotime("+1 year"));
74 
75  // (date_to_check, date_fmt, min_accepted_date, max_accepted_date, expected_result)
76  return [
77  'missing birthday' => ['', 'Y-m-d', '','', ''],
78  'zeros birthday' => ['000000','' ,'','', ''],
79  'bad birthday' => ['1983-02-56', 'm/d/Y', '1950-12-31','10-31-2019',''],
80  'nonDigit birthday' => ['October', '','','', ''],
81  'old birthday' => ['1933-09-11', 'Y-m-d','1950-12-31','10-31-2019',''],
82  'older birthday' => ['1833-09-11', 'Y-m-d','','',''],
83  'future birthday' => [$nextyear,'Y-m-d','','','']
84  ];
85  }
86  public function PhoneProvider()
87  {
88  //(MIR_packet_data, HCU_email, required_in_MIR_result, phones_format, item_to_examine, expected_result)
89  return [
90  'phones flat' => [
91  ['accountnumber' => '22891',
92  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
93  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
94  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
95  'address1' => '373 Richland Ave', 'address2' => '',
96  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
97  'dob' => '1991-02-28', 'class' => 'P'],
98  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'flat',
99  'phone','2085550228'],
100 
101  'phones named' => [
102  ['accountnumber' => '22891',
103  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
104  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
105  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
106  'address1' => '373 Richland Ave', 'address2' => '',
107  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
108  'dob' => '1991-02-28', 'class' => 'P'],
109  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'named',
110  'phonenumbers',[0=>['number' => '208-555-0228', 'name' => 'Home']] ],
111 
112  'phones shortname' => [
113  ['accountnumber' => '22891',
114  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
115  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
116  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
117  'address1' => '373 Richland Ave', 'address2' => '',
118  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
119  'dob' => '1991-02-28', 'class' => 'P'],
120  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'shortname',
121  'phonenumbers',[0=>['number' => '2085550228', 'name' => 'Home', 'isTextCapable' => false]] ],
122 
123  'phones shortname nogood' => [
124  ['accountnumber' => '22891',
125  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
126  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-228',
127  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
128  'address1' => '373 Richland Ave', 'address2' => '',
129  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
130  'dob' => '1991-02-28', 'class' => 'P'],
131  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'shortname',
132  'phonenumbers',null ],
133 
134  'phones shortname allfull' => [
135  ['accountnumber' => '22891',
136  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
137  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
138  'workphone' => '208-555-0310', 'cellphone' => '417-555-0927', 'fax' => '', 'ssn' => '228-29-3342',
139  'address1' => '373 Richland Ave', 'address2' => '',
140  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
141  'dob' => '1991-02-28', 'class' => 'P'],
142  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'shortname',
143  'phonenumbers',[0=>['number' => '2085550228', 'name' => 'Home', 'isTextCapable' => false],
144  1=>['number' => '4175550927', 'name' => 'Cell', 'isTextCapable' => true],
145  2=>['number' => '2085550310', 'name' => 'Work', 'isTextCapable' => false]] ],
146 
147  'phones split' => [
148  ['accountnumber' => '22891',
149  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
150  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
151  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
152  'address1' => '373 Richland Ave', 'address2' => '',
153  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
154  'dob' => '1991-02-28', 'class' => 'P'],
155  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'split',
156  'homephone',['area' => '208','pre' => '555','num' => '0228'] ],
157 
158  'phones cascade' => [
159  ['accountnumber' => '22891',
160  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
161  'email' => 'youngson@yahoo.com', 'homephone' => '',
162  'workphone' => '', 'cellphone' => '2085550228', 'fax' => '', 'ssn' => '228-29-3342',
163  'address1' => '373 Richland Ave', 'address2' => '',
164  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
165  'dob' => '1991-02-28', 'class' => 'P'],
166  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'flat',
167  'phone','2085550228'],
168 
169  'missing phones' => [
170  ['accountnumber' => '22891',
171  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
172  'email' => 'youngson@yahoo.com', 'homephone' => '',
173  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
174  'address1' => '373 Richland Ave', 'address2' => '',
175  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
176  'dob' => '1991-02-28', 'class' => 'P'],
177  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'flat',
178  'phone', NULL],
179 
180  'nonDigit phones' => [
181  ['accountnumber' => '22891',
182  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
183  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-test',
184  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
185  'address1' => '373 Richland Ave', 'address2' => '',
186  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
187  'dob' => '1991-02-28', 'class' => 'P'],
188  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'flat',
189  'phone',NULL],
190 
191  'short phones' => [
192  ['accountnumber' => '22891',
193  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
194  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-',
195  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
196  'address1' => '373 Richland Ave', 'address2' => '',
197  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
198  'dob' => '1991-02-28', 'class' => 'P'],
199  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'flat',
200  'phone',NULL],
201 
202  'long phones' => [
203  ['accountnumber' => '22891',
204  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
205  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-330228',
206  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
207  'address1' => '373 Richland Ave', 'address2' => '',
208  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
209  'dob' => '1991-02-28', 'class' => 'P'],
210  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'flat',
211  'phone', NULL],
212 
213  ];
214  }
215  public function MIRProvider()
216  {
217  date_default_timezone_set('UTC');
218  $nextyear = date('m-d-Y', strtotime("+1 year"));
219 
220  //(MIR_packet_data, HCU_email, required_in_MIR_result, date_fmt, phones_format,
221  // unset_Empty_values, empty_FN_as_dot, item_to_examine, expected_result)
222  return [
223  'valid packet' => [
224  ['accountnumber' => '22891',
225  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
226  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
227  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
228  'address1' => '373 Richland Ave', 'address2' => '',
229  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
230  'dob' => '1991-02-28', 'class' => 'P'],
231  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '', 'email','nobody@home.net'],
232 
233  'business FNdot' => [
234  ['accountnumber' => '22891',
235  'firstname' => '', 'middlename' => '','lastname' => 'Williams',
236  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
237  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
238  'address1' => '373 Richland Ave', 'address2' => '',
239  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
240  'dob' => '1991-02-28', 'class' => ''],
241  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, 'dot','firstname','.'],
242 
243  'personal FNdot' => [
244  ['accountnumber' => '22891',
245  'firstname' => '', 'middlename' => '','lastname' => 'Williams',
246  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
247  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
248  'address1' => '373 Richland Ave', 'address2' => '',
249  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
250  'dob' => '1991-02-28', 'class' => 'P'],
251  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, 'dot','firstname',''],
252 
253  'business FNempty' => [
254  ['accountnumber' => '22891',
255  'firstname' => '', 'middlename' => '','lastname' => 'Williams',
256  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
257  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
258  'address1' => '373 Richland Ave', 'address2' => '',
259  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
260  'dob' => '1991-02-28', 'class' => ''],
261  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','firstname',''],
262 
263  'business FNpass' => [
264  ['accountnumber' => '22891',
265  'firstname' => '', 'middlename' => '','lastname' => 'Williams',
266  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
267  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
268  'address1' => '373 Richland Ave', 'address2' => '',
269  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
270  'dob' => '1991-02-28', 'class' => ''],
271  'nobody@home.net', ['accountnumber'=>1,'firstname'=>1,'email'=>1],'Y-m-d','flat',false, 'pass','firstname',''],
272 
273  'business FNdot named' => [
274  ['accountnumber' => '22891',
275  'firstname' => 'Abe', 'middlename' => '','lastname' => 'Williams',
276  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
277  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
278  'address1' => '373 Richland Ave', 'address2' => '',
279  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
280  'dob' => '1991-02-28', 'class' => ''],
281  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, 'dot','firstname','Abe'],
282 
283  'business FNempty named' => [
284  ['accountnumber' => '22891',
285  'firstname' => 'Abe', 'middlename' => '','lastname' => 'Williams',
286  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
287  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
288  'address1' => '373 Richland Ave', 'address2' => '',
289  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
290  'dob' => '1991-02-28', 'class' => ''],
291  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','firstname','Abe'],
292 
293  'business FNpass named' => [
294  ['accountnumber' => '22891',
295  'firstname' => 'Abe', 'middlename' => '','lastname' => 'Williams',
296  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
297  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
298  'address1' => '373 Richland Ave', 'address2' => '',
299  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
300  'dob' => '1991-02-28', 'class' => ''],
301  'nobody@home.net', ['accountnumber'=>1,'firstname'=>1,'email'=>1],'Y-m-d','flat',false, 'pass','firstname','Abe'],
302 
303  'valid birthday Y-m-d' => [
304  ['accountnumber' => '22891',
305  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
306  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
307  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
308  'address1' => '373 Richland Ave', 'address2' => '',
309  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
310  'dob' => '1991-02-28', 'class' => 'P'],
311  'nobody@home.net', ['accountnumber'=>1,'email'=>1, 'dob'=>1],'Y-m-d','flat',false, '','dob','1991-02-28'],
312 
313  'valid birthday Ymd' => [
314  ['accountnumber' => '22891',
315  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
316  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
317  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
318  'address1' => '373 Richland Ave', 'address2' => '',
319  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
320  'dob' => '1991-02-28', 'class' => 'P'],
321  'nobody@home.net', ['accountnumber'=>1,'email'=>1, 'dob'=>1],'Y-m-d','flat',false, '','dob','1991-02-28'],
322 
323  'valid birthday m/d/Y' => [
324  ['accountnumber' => '22891',
325  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
326  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
327  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
328  'address1' => '373 Richland Ave', 'address2' => '',
329  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
330  'dob' => '02/28/1991', 'class' => 'P'],
331  'nobody@home.net', ['accountnumber'=>1,'email'=>1, 'dob'=>1],'Y-m-d','flat',false, '','dob','1991-02-28'],
332 
333  'birthday trailing chars' => [
334  ['accountnumber' => '22891',
335  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
336  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
337  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
338  'address1' => '373 Richland Ave', 'address2' => '',
339  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
340  'dob' => '1991-02-28 abc', 'class' => 'P'],
341  'nobody@home.net', ['accountnumber'=>1,'email'=>1, 'dob'=>1],'Y-m-d','flat',false, '','dob',''],
342 
343  'missing birthday' => [
344  ['accountnumber' => '22891',
345  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
346  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
347  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
348  'address1' => '373 Richland Ave', 'address2' => '',
349  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
350  'dob' => '', 'class' => 'P'],
351  'nobody@home.net', ['accountnumber'=>1,'email'=>1, 'dob'=>1],'Y-m-d','flat',false, '','dob',''],
352 
353  'zeros birthday' => [
354  ['accountnumber' => '22891',
355  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
356  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
357  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
358  'address1' => '373 Richland Ave', 'address2' => '',
359  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
360  'dob' => '00-00-0000', 'class' => 'P'],
361  'nobody@home.net', ['accountnumber'=>1,'email'=>1, 'dob'=>1],'Y-m-d','flat',false, '','dob',''],
362 
363  'bad birthday' => [
364  ['accountnumber' => '22891',
365  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
366  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
367  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
368  'address1' => '373 Richland Ave', 'address2' => '',
369  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
370  'dob' => '1991-22-31', 'class' => 'P'],
371  'nobody@home.net', ['accountnumber'=>1,'email'=>1, 'dob'=>1],'Y-m-d','flat',false, '','dob',''],
372 
373  'nonDigit valid birthday' => [
374  ['accountnumber' => '22891',
375  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
376  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
377  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
378  'address1' => '373 Richland Ave', 'address2' => '',
379  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
380  'dob' => '1991-Feb-28', 'class' => 'P'],
381  'nobody@home.net', ['accountnumber'=>1,'email'=>1, 'dob'=>1],'Y-m-d','flat',false, '','dob','1991-02-28'],
382 
383  'nonDigit invalid birthday' => [
384  ['accountnumber' => '22891',
385  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
386  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
387  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
388  'address1' => '373 Richland Ave', 'address2' => '',
389  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
390  'dob' => '1991ish-Feb-28', 'class' => 'P'],
391  'nobody@home.net', ['accountnumber'=>1,'email'=>1, 'dob'=>1],'Y-m-d','flat',false, '','dob',''],
392 
393  'Digits-only birthday' => [
394  ['accountnumber' => '22891',
395  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
396  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
397  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
398  'address1' => '373 Richland Ave', 'address2' => '',
399  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
400  'dob' => '19910228', 'class' => 'P'],
401  'nobody@home.net', ['accountnumber'=>1,'email'=>1, 'dob'=>1],'Y-m-d','flat',false, '','dob','1991-02-28'],
402 
403  'old birthday' => [
404  ['accountnumber' => '22891',
405  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
406  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
407  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
408  'address1' => '373 Richland Ave', 'address2' => '',
409  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
410  'dob' => '1891-02-28', 'class' => 'P'],
411  'nobody@home.net', ['accountnumber'=>1,'email'=>1, 'dob'=>1],'Y-m-d','flat',false, '','dob',''],
412 
413  'future birthday' => [
414  ['accountnumber' => '22891',
415  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
416  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
417  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
418  'address1' => '373 Richland Ave', 'address2' => '',
419  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
420  'dob' => $nextyear, 'class' => 'P'],
421  'nobody@home.net', ['accountnumber'=>1,'email'=>1, 'dob'=>1],'Y-m-d','flat',false, false,'dob',''],
422 
423  'missing required' => [
424  ['accountnumber' => '22891',
425  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
426  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
427  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
428  'address1' => '', 'address2' => '',
429  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
430  'dob' => '1991-02-28', 'class' => 'P'],
431  'nobody@home.net', ['accountnumber'=>1,'email'=>1, 'address1' => 1],'Y-m-d','flat',false, '','address1',''],
432 
433  'malformed email' => [
434  ['accountnumber' => '22891',
435  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
436  'email' => 'youngson.yahoo.com', 'homephone' => '208-555-0228',
437  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
438  'address1' => '373 Richland Ave', 'address2' => '',
439  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
440  'dob' => '1991-02-28', 'class' => 'P'],
441  'nobody.home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','email',NULL],
442 
443  'badchar email' => [
444  ['accountnumber' => '22891',
445  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
446  'email' => 'youngson#3@yahoo.com', 'homephone' => '208-555-0228',
447  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
448  'address1' => '373 Richland Ave', 'address2' => '',
449  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
450  'dob' => '1991-02-28', 'class' => 'P'],
451  'nobody.home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','email','youngson3@yahoo.com'],
452 
453  'missing MIRemail' => [
454  ['accountnumber' => '22891',
455  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
456  'email' => '', 'homephone' => '208-555-0228',
457  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
458  'address1' => '373 Richland Ave', 'address2' => '',
459  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
460  'dob' => '1991-02-28', 'class' => 'P'],
461  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','email','nobody@home.net'],
462 
463  'missing email parm' => [
464  ['accountnumber' => '22891',
465  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
466  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
467  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
468  'address1' => '373 Richland Ave', 'address2' => '',
469  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
470  'dob' => '1991-02-28', 'class' => 'P'],
471  '', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','email','youngson@yahoo.com'],
472 
473  'missing SSN' => [
474  ['accountnumber' => '22891',
475  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
476  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
477  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '',
478  'address1' => '373 Richland Ave', 'address2' => '',
479  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
480  'dob' => '1991-02-28', 'class' => 'P'],
481  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','ssn',''],
482 
483  'nonDigit SSN' => [
484  ['accountnumber' => '22891',
485  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
486  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
487  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-ab-3342',
488  'address1' => '373 Richland Ave', 'address2' => '',
489  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
490  'dob' => '1991-02-28', 'class' => 'P'],
491  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','ssn',''],
492 
493  'short SSN' => [
494  ['accountnumber' => '22891',
495  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
496  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
497  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29342',
498  'address1' => '373 Richland Ave', 'address2' => '',
499  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
500  'dob' => '1991-02-28', 'class' => 'P'],
501  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','ssn',''],
502 
503  'long SSN' => [
504  ['accountnumber' => '22891',
505  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
506  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
507  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-33422',
508  'address1' => '373 Richland Ave', 'address2' => '',
509  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
510  'dob' => '1991-02-28', 'class' => 'P'],
511  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','ssn',''],
512 
513  'missing ZIP' => [
514  ['accountnumber' => '22891',
515  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
516  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
517  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
518  'address1' => '373 Richland Ave', 'address2' => '',
519  'city' => 'Shire', 'state' => 'ID', 'zip' => '', 'cc' => 'US',
520  'dob' => '1991-02-28', 'class' => 'P'],
521  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','zip',''],
522 
523  'nonDigit ZIP' => [
524  ['accountnumber' => '22891',
525  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
526  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
527  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
528  'address1' => '373 Richland Ave', 'address2' => '',
529  'city' => 'Shire', 'state' => 'ID', 'zip' => 'a8111', 'cc' => 'US',
530  'dob' => '1991-02-28', 'class' => 'P'],
531  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','zip',''],
532 
533  'short ZIP' => [
534  ['accountnumber' => '22891',
535  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
536  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
537  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
538  'address1' => '373 Richland Ave', 'address2' => '',
539  'city' => 'Shire', 'state' => 'ID', 'zip' => '8311', 'cc' => 'US',
540  'dob' => '1991-02-28', 'class' => 'P'],
541  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','zip',''],
542 
543  'long ZIP' => [
544  ['accountnumber' => '22891',
545  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
546  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
547  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
548  'address1' => '373 Richland Ave', 'address2' => '',
549  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111-11111', 'cc' => 'US',
550  'dob' => '1991-02-28', 'class' => 'P'],
551  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','zip',''],
552 
553  'nonAlpha state' => [
554  ['accountnumber' => '22891',
555  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
556  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
557  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
558  'address1' => '373 Richland Ave', 'address2' => '',
559  'city' => 'Shire', 'state' => '99', 'zip' => '83111', 'cc' => 'US',
560  'dob' => '1991-02-28', 'class' => 'P'],
561  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',false, '','state',''],
562 
563  'noEmpties' => [
564  ['accountnumber' => '22891',
565  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
566  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
567  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
568  'address1' => '373 Richland Ave', 'address2' => '',
569  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
570  'dob' => '1991-02-28', 'class' => 'P'],
571  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',true, '','address2',NULL],
572 
573  'noEmpties flat ph' => [
574  ['accountnumber' => '22891',
575  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
576  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
577  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
578  'address1' => '373 Richland Ave', 'address2' => '',
579  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
580  'dob' => '1991-02-28', 'class' => 'P'],
581  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','flat',true, '','phone','2085550228'],
582 
583  'noEmpties split ph' => [
584  ['accountnumber' => '22891',
585  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
586  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
587  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
588  'address1' => '373 Richland Ave', 'address2' => '',
589  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
590  'dob' => '1991-02-28', 'class' => 'P'],
591  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','split',true, '',
592  'homephone',['area' => '208','pre' => '555','num' => '0228']],
593 
594  'noEmpties named ph' => [
595  ['accountnumber' => '22891',
596  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
597  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
598  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
599  'address1' => '373 Richland Ave', 'address2' => '',
600  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
601  'dob' => '1991-02-28', 'class' => 'P'],
602  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','named',true, '',
603  'phonenumbers',[0=>['number' => '208-555-0228', 'name' => 'Home']] ],
604 
605  'noEmpties shortname ph' => [
606  ['accountnumber' => '22891',
607  'firstname' => 'Kevin', 'middlename' => 'O','lastname' => 'Williams',
608  'email' => 'youngson@yahoo.com', 'homephone' => '208-555-0228',
609  'workphone' => '', 'cellphone' => '', 'fax' => '', 'ssn' => '228-29-3342',
610  'address1' => '373 Richland Ave', 'address2' => '',
611  'city' => 'Shire', 'state' => 'ID', 'zip' => '83111', 'cc' => 'US',
612  'dob' => '1991-02-28', 'class' => 'P'],
613  'nobody@home.net', ['accountnumber'=>1,'email'=>1],'Y-m-d','shortname',true, '',
614  'phonenumbers',[0=>['number' => '2085550228', 'name' => 'Home', 'isTextCapable' => false]]]
615 
616  ];
617  }
618 }
test_DateFmt($datechk, $datefmt, $mindate, $maxdate, $expected)
test_rePhone($phone, $expected)
test_MIRData($MIR, $Ml, $reqMIR, $datefmt, $phones, $noEmpty, $BizFNdot, $examine, $expected)
test_PhoneFormat($MIR, $Ml, $reqMIR, $phones, $examine, $expected)