2 use PHPUnit\Framework\TestCase;
4 require_once(
"rdcTZtest.i");
5 require_once(
"hcuCommon.i");
15 $this->assertTrue(
true);
16 $vendorInfo = json_decode(
'{"Vendortime":1572870689,"userAgent":"Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 iPhone iPhone11,8","userIP":"172.56.10.140","accounts":{"D|803633|0|0":{"accounttype":"0","suffix":"803633000","certnumber":"0","acctclass":"D","description":"803633 / Regular Share - 0","tokn":"a7aa649acd1483aa2120ea6a528ef6f919c03ab7","Uid":"2414","trust":"primary","displaydesc":"803633 / Regular Share - 0","rdctype":"2","rdcdesc":"Savings","rdcmember":"803633","ScanLimitAmount":null},"D|803633|9|0":{"accounttype":"9","suffix":"8036330095","certnumber":"0","acctclass":"D","description":"803633 / Share Draft - 9","tokn":"0575e3a57ff283e2f22421f4f8066cfd0d989288","Uid":"2414","trust":"primary","displaydesc":"803633 / Share Draft - 9","rdctype":"1","rdcdesc":"Checking","rdcmember":"803633","ScanLimitAmount":null}},"depmessages":[],"tzToken":"urn:ietf:params:oauth:token-type:jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkFrRHp6V3ZmV0MwN0RNWE5TdFBBNTFZWFF3OCJ9.eyJpc3MiOiJodHRwczovL2xvZ2luLnRyYW56YWN0Lm9yZyIsImF1ZCI6Imh0dHBzOi8vd3d3LnRyYW56YWN0Lm9yZy8iLCJuYmYiOjE1NzI4NzA2MTAsImV4cCI6MTU3Mjg4NTAxMCwiaHR0cDovL2lkZW50aXR5c2VydmVyLnRoaW5rdGVjdHVyZS5jb20vY2xhaW1zL2NsaWVudCI6Ik1vYmlsZSIsImh0dHA6Ly9pZGVudGl0eXNlcnZlci50aGlua3RlY3R1cmUuY29tL2NsYWltcy9zY29wZSI6Imh0dHBzOi8vd3d3LnRyYW56YWN0Lm9yZy8iLCJodHRwOi8vaWRlbnRpdHlzZXJ2ZXIudGhpbmt0ZWN0dXJlLmNvbS9jbGFpbXMvY2xpZW50aWQiOiIzMyIsInVuaXF1ZV9uYW1lIjoiQ29ycE9uZUhvbWVDVSIsImF1dGhtZXRob2QiOiJPQXV0aDIiLCJhdXRoX3RpbWUiOiIyMDE5LTExLTA0VDEyOjMwOjEwLjE4NFoifQ.I4GaQHX90lRRur_B6o16F6IXwxRQbqSPjNyNV63WFzJKNQ1ZQbffmPn19J4fRvDdybuNU2PxQssz0hbRWeVcwgwdvA0ddHEOvwXZkfpISSW26h3nkqb3P-GN7n6lSaYo012_kudkvFJcwpsw9WbvXgst5T2an9j-6rn36hmVO9W4F8wEMz6WrTcGMaFur-88qfHKn4ZKuyaJbCixbqz4yBSsKgBCr8im5qMiLh4cRRaY6_aPfKyCcILhFj-SC--8Smz4-Zn3rMDfN4OudujR6raZLdXEV_jZ_cubCKxw8gJ96bfmuduWBU2SJ9F2wNsXyeMOQ7iu2jJ6PDG8vn2jUw","tzToken_expires":1572885004,"DepositStatus":"Failed","Message":"You must endorse your check "For Mobile Deposit Only".","DepositTime":"20191104123129"}',
true);
25 $this->assertTrue(
true);
26 $rdcParms = [
'depositid' => 108015,
27 'acctid' =>
'D|803633|9|0',
38 public function test_Deposit($response, $respHTTP, $respCURL, $examine, $expected, $vendorInfo, $rdcParms)
40 $postItem = Deposit_Responder($response, $respHTTP, $respCURL, $vendorInfo, $rdcParms);
42 $this->assertArraySubset([$examine => $expected], $postItem[
'data'],
false, print_r($postItem,
true));
49 public function test_PostItem($response, $respHTTP, $respCURL, $examine, $expected)
51 $postItem = PostItem_Responder($response, $respHTTP, $respCURL, $vendorInfo);
53 $this->assertArraySubset([$examine => $expected], $postItem[
'data'],
false, print_r($postItem,
true));
61 public function test_EmbCurl($response, $respHTTP, $respCURL, $examine, $expected)
63 $embCurl = EmbCurl_Responder($response, $respHTTP, $respCURL);
65 $this->assertArraySubset([$examine => $expected], $embCurl,
false, print_r($embCurl,
true));
68 public function DepositProvider()
72 '{"BatchID":55118169,"ItemID":474254586,"WasSuccessful":true,"ErrorMessage":null}',
78 'rejected response' => [
79 '{"BatchID":null,"ItemID":null,"WasSuccessful":false,"ErrorMessage":"You must endorse your check \"For Mobile Deposit Only\"."}',
86 'rejected bad image' => [
87 '{"BatchID":null,"ItemID":null,"WasSuccessful":false,"ErrorMessage":"Cannot read acct. data on bottom of check. Please retake. Ensure focus and all four corners visible."}',
94 'rejected no endorsement' => [
95 '{"BatchID":null,"ItemID":null,"WasSuccessful":false,"ErrorMessage":"We cannot detect an endorsement. Please retake photo and ensure the check is endorsed."}',
103 'empty response' => [
111 'curlERR7 response' => [
119 'httpERR403 response' => [
130 public function PostItemProvider()
133 'valid response' => [
134 '{"BatchID":55118169,"ItemID":474254586,"WasSuccessful":true,"ErrorMessage":null}',
140 'rejected response' => [
141 '{"BatchID":null,"ItemID":null,"WasSuccessful":false,"ErrorMessage":"You must endorse your check \"For Mobile Deposit Only\"."}',
148 'rejected bad image' => [
149 '{"BatchID":null,"ItemID":null,"WasSuccessful":false,"ErrorMessage":"Cannot read acct. data on bottom of check. Please retake. Ensure focus and all four corners visible."}',
156 'rejected no endorsement' => [
157 '{"BatchID":null,"ItemID":null,"WasSuccessful":false,"ErrorMessage":"We cannot detect an endorsement. Please retake photo and ensure the check is endorsed."}',
164 'empty response' => [
172 'curlERR7 response' => [
180 'httpERR403 response' => [
190 public function EmbCurlProvider()
193 'valid response' => [
194 '{"BatchID":55118169,"ItemID":474254586,"WasSuccessful":true,"ErrorMessage":null}',
201 'rejected response' => [
202 '{"BatchID":null,"ItemID":null,"WasSuccessful":false,"ErrorMessage":"You must endorse your check \"For Mobile Deposit Only\"."}',
209 'empty response' => [
217 'curlERR7 response' => [
225 'httpERR403 response' => [
233 'layered response' => [
234 '[ { "Property": "", "Message": "Cannot add a user that already exists.", "Value": { "UserId": "3974", "AccountNumber": "0000397450", "FirstName": null, "LastName": null, "PhoneNumber": null, "EmailAddress": "luvinfrogs.sh@gmail.com", "AccountType": 1 } } ]',
241 'badJson response' => [
test_PostItem($response, $respHTTP, $respCURL, $examine, $expected)
test_EmbCurl($response, $respHTTP, $respCURL, $examine, $expected)
test_Deposit($response, $respHTTP, $respCURL, $examine, $expected, $vendorInfo, $rdcParms)