Odyssey
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TestCuTdApi Class Reference
Inheritance diagram for TestCuTdApi:

Public Member Functions

 test_has_results_with_single_trust_id_and_empty_cu ()
 
 test_has_results_with_single_trust_id_and_has_cu ()
 
 test_has_results_with_array_of_trust_ids_and_empty_cu ()
 
 test_test_has_results_with_single_trust_id_and_has_cu ()
 

Protected Member Functions

 runAssertions ($post)
 
 singleTrustIdEmptyCuResult ()
 
 singleTrustIdScrubCuResult ()
 
 trustIdArrayNoCu ()
 
 trustIdArrayScrubCu ()
 
 postToUrl ($post)
 

Protected Attributes

 $your_cookie = ''
 
 $url = 'http://www4.homecu.net/hcuadm/CuVendorListApi.prg'
 

Detailed Description

Unit test for the cutd_list() api. cutd_list() allows usage of a single trusted ID or an array of trusted id's, other functions accessing it nuke/ don't use the input of $_POST['trustedids'].

************************* NOTE TO TEST LIVE CONNECTION ************************** This will require one modification: your HCUticket cookie for www4. The HCUticket value can be obtained by viewing your logged in cookies in the browser or doing a D & D of $_COOKIE somewhere (after logging into www4.) Place the resulting value in the "your_cookie" property below.


Definition at line 17 of file TestCuTdApi.php.

Member Function Documentation

◆ postToUrl()

TestCuTdApi::postToUrl (   $post)
protected

Basic native curl call for tests. Use only yo test live, do not leave calls in unit test.

Parameters
array[Cu => string optional, trustid => string optional, trustids => string (JSON encoded array), optional]
Returns
array

Definition at line 272 of file TestCuTdApi.php.

273  {
274  $params = http_build_query($post);
275 
276  $curlcookies = "HCUTicket={$this->your_cookie};";
277 
278  $ch = curl_init($this->url);
279  curl_setopt($ch,CURLOPT_COOKIE, $curlcookies);
280  curl_setopt($ch,CURLOPT_USERPWD,"nobody:no1home");
281  curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
282  curl_setopt($ch,CURLOPT_POST, true);
283  curl_setopt($ch,CURLOPT_POSTFIELDS, $params);
284  //curl_setopt($ch, CURLOPT_VERBOSE, true);
285 
286  $rawresp = curl_exec($ch);
287 
288  return json_decode($rawresp, true);
289  }

◆ runAssertions()

TestCuTdApi::runAssertions (   $post)
protected

Common to all live tests, run assertions that check if we have an array with status and data members.

Parameters
array$post
Returns
void

Definition at line 126 of file TestCuTdApi.php.

127  {
128  $result = $this->postToUrl($post);
129  $this->assertArrayHasKey('status', $result);
130  $this->assertArrayHasKey('data', $result);
131  }
postToUrl($post)

◆ singleTrustIdEmptyCuResult()

TestCuTdApi::singleTrustIdEmptyCuResult ( )
protected

Mock the response received from a live curl call, single trust ID, no CU.

Returns
array

Definition at line 137 of file TestCuTdApi.php.

138  {
139  return [
140  'status' => [
141  'Response' => true,
142  'Message' => 'OK',
143  'Errors' => []
144  ],
145  'data' => [
146  'SCRUBCU|IPAY_V3]' => [
147  'cu' => 'SCRUBCU',
148  'trustedid' => 'IPAY_V3',
149  'fields' => []
150  ],
151  'CRUISECU|IPAY_V3]' => [
152  'cu' => 'CRUISECU',
153  'trustedid' => 'IPAY_V3',
154  'fields' => []
155  ]
156  ]
157  ];
158  }

◆ singleTrustIdScrubCuResult()

TestCuTdApi::singleTrustIdScrubCuResult ( )
protected

Mock the response received from a live curl call, single trust ID, SCRUBCU.

Returns
array

Definition at line 164 of file TestCuTdApi.php.

165  {
166  return [
167  'status' => [
168  'Response' => true,
169  'Message' => 'OK',
170  'Errors' => []
171  ],
172  'data' => [
173  'SCRUBCU|IPAY_V3]' => [
174  'cu' => 'SCRUBCU',
175  'trustedid' => 'IPAY_V3',
176  'fields' => []
177  ]
178  ]
179  ];
180  }

◆ test_has_results_with_array_of_trust_ids_and_empty_cu()

TestCuTdApi::test_has_results_with_array_of_trust_ids_and_empty_cu ( )

Test API, array of ID's, empty Cu.

Returns
void

Definition at line 71 of file TestCuTdApi.php.

72  {
73  $post = [
74  'Cu' => '',
75  'trustedids' => json_encode([
76  'abeAI', 'ACCSOFT', 'ALLIEDPAY_SSO', 'MWI_LOANPAY', 'BDI', 'RDCBluepoint', 'RDCTranzCap', 'CERTEGY',
77  'RDCCheckAlt', 'CHKFREE', 'CUDIRECT_SSO', 'DELUXE_OP', 'Bit', 'Digital', 'DMI', 'HcuDMI', 'MemberPay',
78  'RDCENSENTA', 'ENSENTA_BRDC', 'FICS', 'HcuEZCARD', 'FIS_EZCARD', 'FISERV_CPS', 'RDCTest', 'FWDTranzCap',
79  'MBLPAY_TEST', 'hcuLoanApp', 'HcuMIR', 'HOMECUSERVICE', 'HcuCheckImages', 'IDS_ES', 'IPAY', 'IPAYMBL',
80  'IPAY_V3', 'IPAYBPS', 'IPAYAPP', 'IPAYTEST', 'LASERPRINT_ES', 'LASERTEC_ES', 'MDesk3', 'MDesk',
81  'PAYVERIS', 'PAYZUR_SSO', 'PSCUPAY_SSO', 'PSCUPAY_API', 'PSCUINFO', 'PSCU_ACCPT', 'SavvyMo_SSO',
82  'ThinkDigital', 'RDCDigiliti', 'GOTOMYCARD', 'RDCVsoft', 'VSOFT', 'WebShare', 'MeridianLink'
83  ])
84  ];
85 
86  // Use this to actually post.
87  //$this->runAssertions($post);
88 
89  $result = $this->trustIdArrayNoCu();
90  $this->assertArrayHasKey('status', $result);
91  $this->assertArrayHasKey('data', $result);
92  }

◆ test_has_results_with_single_trust_id_and_empty_cu()

TestCuTdApi::test_has_results_with_single_trust_id_and_empty_cu ( )

Test API, single trust ID, empty Cu.

Returns
void

Definition at line 35 of file TestCuTdApi.php.

36  {
37  $post = [
38  'Cu' => '',
39  'trustedid' => 'IPAY_V3'
40  ];
41  // Use this to actually post.
42  //$this->runAssertions($post);
43 
44  $result = $this->singleTrustIdEmptyCuResult();
45  $this->assertArrayHasKey('status', $result);
46  $this->assertArrayHasKey('data', $result);
47  }
singleTrustIdEmptyCuResult()

◆ test_has_results_with_single_trust_id_and_has_cu()

TestCuTdApi::test_has_results_with_single_trust_id_and_has_cu ( )

Test API, single trust ID and SCRUBCU.

Returns
void

Definition at line 53 of file TestCuTdApi.php.

54  {
55  $post = [
56  'Cu' => 'SCRUBCU',
57  'trustedid' => 'IPAY_V3'
58  ];
59  // Use this to actually post.
60  //$this->runAssertions($post);
61 
62  $result = $this->singleTrustIdScrubCuResult();
63  $this->assertArrayHasKey('status', $result);
64  $this->assertArrayHasKey('data', $result);
65  }
singleTrustIdScrubCuResult()

◆ test_test_has_results_with_single_trust_id_and_has_cu()

TestCuTdApi::test_test_has_results_with_single_trust_id_and_has_cu ( )

Test API, array of ID's, SCRUBCU.

Returns
void

Definition at line 98 of file TestCuTdApi.php.

99  {
100  $post = [
101  'Cu' => 'SCRUBCU',
102  'trustedids' => json_encode([
103  'abeAI', 'ACCSOFT', 'ALLIEDPAY_SSO', 'MWI_LOANPAY', 'BDI', 'RDCBluepoint', 'RDCTranzCap', 'CERTEGY',
104  'RDCCheckAlt', 'CHKFREE', 'CUDIRECT_SSO', 'DELUXE_OP', 'Bit', 'Digital', 'DMI', 'HcuDMI', 'MemberPay',
105  'RDCENSENTA', 'ENSENTA_BRDC', 'FICS', 'HcuEZCARD', 'FIS_EZCARD', 'FISERV_CPS', 'RDCTest', 'FWDTranzCap',
106  'MBLPAY_TEST', 'hcuLoanApp', 'HcuMIR', 'HOMECUSERVICE', 'HcuCheckImages', 'IDS_ES', 'IPAY', 'IPAYMBL',
107  'IPAY_V3', 'IPAYBPS', 'IPAYAPP', 'IPAYTEST', 'LASERPRINT_ES', 'LASERTEC_ES', 'MDesk3', 'MDesk',
108  'PAYVERIS', 'PAYZUR_SSO', 'PSCUPAY_SSO', 'PSCUPAY_API', 'PSCUINFO', 'PSCU_ACCPT', 'SavvyMo_SSO',
109  'ThinkDigital', 'RDCDigiliti', 'GOTOMYCARD', 'RDCVsoft', 'VSOFT', 'WebShare', 'MeridianLink'
110  ])
111  ];
112 
113  // Use this to actually post.
114  //$this->runAssertions($post);
115 
116  $result = $this->trustIdArrayNoCu();
117  $this->assertArrayHasKey('status', $result);
118  $this->assertArrayHasKey('data', $result);
119  }

◆ trustIdArrayNoCu()

TestCuTdApi::trustIdArrayNoCu ( )
protected

Mock the response with array of trusted ID's and no CU specified. This is a shortened version of the actual return array you'll get.

Returns
array

Definition at line 187 of file TestCuTdApi.php.

188  {
189  return [
190  'status' => [
191  'Response' => true,
192  'Message' => 'OK',
193  'Errors' => []
194  ],
195  'data' => [
196  'SCRUBCU|ACCSOFT' => [
197  'cu' => 'SCRUBCU',
198  'trustedid' => 'CCSOFT',
199  'fields' => [
200  'privateKey' => '',
201  'sharedKey' => '',
202  ]
203  ],
204  'SCRUBCU|CERTEGY' => [
205  'cu' => 'SCRUBCU',
206  'trustedid' => 'CERTEGY',
207  'fields' => [
208  'FIID' => '0006',
209  'ACCOUNT' => '',
210  'pilotURL' => 'https://bp01.premierbillpay.com/servlet/tpservlet',
211  'certegyKey' => '8Pqb@NZ&!JH%g89Fql0m12P$',
212  'pilotKey' => 'pO_cI0m&asoagia4lec#uHI8',
213  'certegyURL' => 'https://sso-redirector.ezbills.com/mvsso/servlet/tpservlet',
214  'pilot' => 0,
215  'hcuLogging' => 0
216  ]
217  ],
218  'CRUISECU|IPAY_V3]' => [
219  'cu' => 'CRUISECU',
220  'trustedid' => 'IPAY_V3',
221  'fields' => []
222  ]
223  ]
224  ];
225  }

◆ trustIdArrayScrubCu()

TestCuTdApi::trustIdArrayScrubCu ( )
protected

Mock the response with an array of trusted ID's and SCRUBCU specified. This is a shortened version of the actual return array you'll get.

Returns
array

Definition at line 232 of file TestCuTdApi.php.

233  {
234  return [
235  'status' => [
236  'Response' => true,
237  'Message' => 'OK',
238  'Errors' => []
239  ],
240  'data' => [
241  'SCRUBCU|ACCSOFT' => [
242  'cu' => 'SCRUBCU',
243  'trustedid' => 'CCSOFT',
244  'fields' => [
245  'privateKey' => '',
246  'sharedKey' => '',
247  ]
248  ],
249  'SCRUBCU|CERTEGY' => [
250  'cu' => 'SCRUBCU',
251  'trustedid' => 'CERTEGY',
252  'fields' => [
253  'FIID' => '0006',
254  'ACCOUNT' => '',
255  'pilotURL' => 'https://bp01.premierbillpay.com/servlet/tpservlet',
256  'certegyKey' => '8Pqb@NZ&!JH%g89Fql0m12P$',
257  'pilotKey' => 'pO_cI0m&asoagia4lec#uHI8',
258  'certegyURL' => 'https://sso-redirector.ezbills.com/mvsso/servlet/tpservlet',
259  'pilot' => 0,
260  'hcuLogging' => 0
261  ]
262  ]
263  ]
264  ];
265  }

The documentation for this class was generated from the following file: