1 | <?php |
||
23 | class OrangePaymentSlipDataTest extends \PHPUnit_Framework_TestCase |
||
24 | { |
||
25 | /** |
||
26 | * The object under test |
||
27 | * |
||
28 | * @var OrangePaymentSlipData |
||
29 | */ |
||
30 | protected $slipData; |
||
31 | |||
32 | /** |
||
33 | * Setup the object under test |
||
34 | * |
||
35 | * @return void |
||
36 | */ |
||
37 | protected function setUp() |
||
41 | |||
42 | /** |
||
43 | * Tests the getWithReferenceNumber and setWithReferenceNumber methods |
||
44 | * |
||
45 | * @return void |
||
46 | * @covers ::setWithReferenceNumber |
||
47 | * @covers ::getWithReferenceNumber |
||
48 | * @covers ::isBool |
||
49 | * @covers ::setReferenceNumber |
||
50 | * @covers ::getReferenceNumber |
||
51 | */ |
||
52 | public function testSetWithReferenceNumber() |
||
73 | |||
74 | /** |
||
75 | * Tests the setReferenceNumber method when disabled |
||
76 | * |
||
77 | * @return void |
||
78 | * @expectedException \SwissPaymentSlip\SwissPaymentSlip\Exception\DisabledDataException |
||
79 | * @expectedExceptionMessage You are accessing the disabled reference number. You need to re-enable it first. |
||
80 | * @covers ::setReferenceNumber |
||
81 | */ |
||
82 | public function testSetReferenceNumberWhenDisabled() |
||
87 | |||
88 | /** |
||
89 | * Tests the getReferenceNumber method when disabled |
||
90 | * |
||
91 | * @return void |
||
92 | * @expectedException \SwissPaymentSlip\SwissPaymentSlip\Exception\DisabledDataException |
||
93 | * @expectedExceptionMessage You are accessing the disabled reference number. You need to re-enable it first. |
||
94 | * @covers ::getReferenceNumber |
||
95 | */ |
||
96 | public function testGetReferenceNumberWhenDisabled() |
||
101 | |||
102 | /** |
||
103 | * Tests the setWithReferenceNumber method with an invalid parameter |
||
104 | * |
||
105 | * @return void |
||
106 | * @expectedException \InvalidArgumentException |
||
107 | * @expectedExceptionMessage $withReferenceNumber is not a boolean. |
||
108 | * @covers ::setWithReferenceNumber |
||
109 | * @covers ::isBool |
||
110 | */ |
||
111 | public function testSetWithReferenceNumberInvalidParameter() |
||
115 | |||
116 | /** |
||
117 | * Tests the getWithBankingCustomerId and setWithBankingCustomerId methods |
||
118 | * |
||
119 | * @return void |
||
120 | * @covers ::setWithBankingCustomerId |
||
121 | * @covers ::getWithBankingCustomerId |
||
122 | * @covers ::isBool |
||
123 | * @covers ::setBankingCustomerId |
||
124 | * @covers ::getBankingCustomerId |
||
125 | */ |
||
126 | public function testSetWithBankingCustomerId() |
||
147 | |||
148 | /** |
||
149 | * Tests the setBankingCustomerId method when disabled |
||
150 | * |
||
151 | * @return void |
||
152 | * @expectedException \SwissPaymentSlip\SwissPaymentSlip\Exception\DisabledDataException |
||
153 | * @expectedExceptionMessage You are accessing the disabled banking customer ID. You need to re-enable it first. |
||
154 | * @covers ::setBankingCustomerId |
||
155 | */ |
||
156 | public function testSetBankingCustomerIdNumberWhenDisabled() |
||
161 | |||
162 | /** |
||
163 | * Tests the getBankingCustomerId method when disabled |
||
164 | * |
||
165 | * @return void |
||
166 | * @expectedException \SwissPaymentSlip\SwissPaymentSlip\Exception\DisabledDataException |
||
167 | * @expectedExceptionMessage You are accessing the disabled banking customer ID. You need to re-enable it first. |
||
168 | * @covers ::getBankingCustomerId |
||
169 | */ |
||
170 | public function testGetBankingCustomerIdNumberWhenDisabled() |
||
175 | |||
176 | /** |
||
177 | * Tests the setWithBankingCustomerId method with an invalid parameter |
||
178 | * |
||
179 | * @return void |
||
180 | * @expectedException \InvalidArgumentException |
||
181 | * @expectedExceptionMessage $withBankingCustomerId is not a boolean. |
||
182 | * @covers ::setWithBankingCustomerId |
||
183 | * @covers ::isBool |
||
184 | */ |
||
185 | public function testSetWithBankingCustomerIdInvalidParameter() |
||
189 | |||
190 | /** |
||
191 | * Tests the getCompleteReferenceNumber method |
||
192 | * Throws exception because of banking customer ID with reference number is longer than max allowed (26) |
||
193 | * |
||
194 | * @return void |
||
195 | * @covers ::setReferenceNumber |
||
196 | */ |
||
197 | public function testSetReferenceNumberLengthExceptionA() |
||
202 | |||
203 | /** |
||
204 | * Tests the getCompleteReferenceNumber method |
||
205 | * Throws exception because of banking customer ID with reference number is longer than max allowed (26) |
||
206 | * |
||
207 | * @return void |
||
208 | * @covers ::setReferenceNumber |
||
209 | */ |
||
210 | public function testSetReferenceNumberLengthExceptionB() |
||
216 | |||
217 | /** |
||
218 | * Tests the setBankingCustomerId method |
||
219 | * Throws exception because of banking customer ID is longer than max (10) |
||
220 | * |
||
221 | * @return void |
||
222 | * @covers ::setBankingCustomerId |
||
223 | */ |
||
224 | public function testsetBankingCustomerIdLengthExceptionA() |
||
229 | |||
230 | /** |
||
231 | * Tests the setBankingCustomerId method |
||
232 | * Throws exception because of banking customer ID is longer than expected by default (6) |
||
233 | * |
||
234 | * @return void |
||
235 | * @covers ::setBankingCustomerId |
||
236 | */ |
||
237 | public function testsetBankingCustomerIdLengthExceptionB() |
||
242 | |||
243 | /** |
||
244 | * Tests the setBankingCustomerId method |
||
245 | * Throws exception because of banking customer ID with reference number is longer than max allowed (26) |
||
246 | * |
||
247 | * @return void |
||
248 | * @covers ::setBankingCustomerId |
||
249 | */ |
||
250 | public function testsetBankingCustomerIdLengthExceptionC() |
||
256 | |||
257 | /** |
||
258 | * Tests the getCompleteReferenceNumber method |
||
259 | * |
||
260 | * @return void |
||
261 | * @covers ::getCompleteReferenceNumber |
||
262 | * @covers ::appendCheckDigit |
||
263 | * @covers ::breakStringIntoBlocks |
||
264 | * @covers ::modulo10 |
||
265 | */ |
||
266 | public function testGetCompleteReferenceNumber() |
||
368 | |||
369 | /** |
||
370 | * Tests the getCompleteReferenceNumber method with the reference number disabled |
||
371 | * |
||
372 | * @return void |
||
373 | * @expectedException \SwissPaymentSlip\SwissPaymentSlip\Exception\DisabledDataException |
||
374 | * @expectedExceptionMessage You are accessing the disabled reference number. You need to re-enable it first. |
||
375 | * @covers ::getCompleteReferenceNumber |
||
376 | * @covers ::getReferenceNumber |
||
377 | */ |
||
378 | public function testGetCompleteReferenceNumberWithReferenceNrDisabled() |
||
383 | |||
384 | /** |
||
385 | * Tests the getCodeLine method |
||
386 | * |
||
387 | * @return void |
||
388 | * @covers ::getCodeLine |
||
389 | * @covers ::modulo10 |
||
390 | * @covers ::getAccountDigits |
||
391 | */ |
||
392 | public function testGetCodeLine() |
||
491 | |||
492 | /** |
||
493 | * Tests the setNotForPayment method |
||
494 | * |
||
495 | * @return void |
||
496 | * @covers ::setNotForPayment |
||
497 | * @covers ::appendCheckDigit |
||
498 | * @covers ::getCompleteReferenceNumber |
||
499 | * @covers ::getCodeLine |
||
500 | * @covers ::getAccountDigits |
||
501 | */ |
||
502 | public function testSetNotForPayment() |
||
514 | |||
515 | /** |
||
516 | * Tests the setNotForPayment method when fields are disabled |
||
517 | * |
||
518 | * @return void |
||
519 | * @covers ::setNotForPayment |
||
520 | */ |
||
521 | public function testSetNotForPaymentDisabledFields() |
||
528 | } |
||
529 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: