1 | <?php |
||
24 | class OrangePaymentSlipDataTest extends \PHPUnit_Framework_TestCase |
||
25 | { |
||
26 | /** |
||
27 | * The object under test |
||
28 | * |
||
29 | * @var OrangePaymentSlipData |
||
30 | */ |
||
31 | protected $slipData; |
||
32 | |||
33 | /** |
||
34 | * Setup the object under test |
||
35 | * |
||
36 | * @return void |
||
37 | */ |
||
38 | protected function setUp() |
||
42 | |||
43 | /** |
||
44 | * Tests the getWithReferenceNumber and setWithReferenceNumber methods |
||
45 | * |
||
46 | * @return void |
||
47 | * @covers ::setWithReferenceNumber |
||
48 | * @covers ::getWithReferenceNumber |
||
49 | * @covers ::isBool |
||
50 | * @covers ::setReferenceNumber |
||
51 | * @covers ::getReferenceNumber |
||
52 | */ |
||
53 | public function testSetWithReferenceNumber() |
||
74 | |||
75 | /** |
||
76 | * Tests the setReferenceNumber method when disabled |
||
77 | * |
||
78 | * @return void |
||
79 | * @expectedException \SwissPaymentSlip\SwissPaymentSlip\Exception\DisabledDataException |
||
80 | * @expectedExceptionMessage You are accessing the disabled reference number. You need to re-enable it first. |
||
81 | * @covers ::setReferenceNumber |
||
82 | */ |
||
83 | public function testSetReferenceNumberWhenDisabled() |
||
88 | |||
89 | /** |
||
90 | * Tests the getReferenceNumber method when disabled |
||
91 | * |
||
92 | * @return void |
||
93 | * @expectedException \SwissPaymentSlip\SwissPaymentSlip\Exception\DisabledDataException |
||
94 | * @expectedExceptionMessage You are accessing the disabled reference number. You need to re-enable it first. |
||
95 | * @covers ::getReferenceNumber |
||
96 | */ |
||
97 | public function testGetReferenceNumberWhenDisabled() |
||
102 | |||
103 | /** |
||
104 | * Tests the setWithReferenceNumber method with an invalid parameter |
||
105 | * |
||
106 | * @return void |
||
107 | * @expectedException \InvalidArgumentException |
||
108 | * @expectedExceptionMessage $withReferenceNumber is not a boolean. |
||
109 | * @covers ::setWithReferenceNumber |
||
110 | * @covers ::isBool |
||
111 | */ |
||
112 | public function testSetWithReferenceNumberInvalidParameter() |
||
116 | |||
117 | /** |
||
118 | * Tests the getWithBankingCustomerId and setWithBankingCustomerId methods |
||
119 | * |
||
120 | * @return void |
||
121 | * @covers ::setWithBankingCustomerId |
||
122 | * @covers ::getWithBankingCustomerId |
||
123 | * @covers ::isBool |
||
124 | * @covers ::setBankingCustomerId |
||
125 | * @covers ::getBankingCustomerId |
||
126 | */ |
||
127 | public function testSetWithBankingCustomerId() |
||
148 | |||
149 | /** |
||
150 | * Tests the setBankingCustomerId method when disabled |
||
151 | * |
||
152 | * @return void |
||
153 | * @expectedException \SwissPaymentSlip\SwissPaymentSlip\Exception\DisabledDataException |
||
154 | * @expectedExceptionMessage You are accessing the disabled banking customer ID. You need to re-enable it first. |
||
155 | * @covers ::setBankingCustomerId |
||
156 | */ |
||
157 | public function testSetBankingCustomerIdNumberWhenDisabled() |
||
162 | |||
163 | /** |
||
164 | * Tests the getBankingCustomerId method when disabled |
||
165 | * |
||
166 | * @return void |
||
167 | * @expectedException \SwissPaymentSlip\SwissPaymentSlip\Exception\DisabledDataException |
||
168 | * @expectedExceptionMessage You are accessing the disabled banking customer ID. You need to re-enable it first. |
||
169 | * @covers ::getBankingCustomerId |
||
170 | */ |
||
171 | public function testGetBankingCustomerIdNumberWhenDisabled() |
||
176 | |||
177 | /** |
||
178 | * Tests the setWithBankingCustomerId method with an invalid parameter |
||
179 | * |
||
180 | * @return void |
||
181 | * @expectedException \InvalidArgumentException |
||
182 | * @expectedExceptionMessage $withBankingCustomerId is not a boolean. |
||
183 | * @covers ::setWithBankingCustomerId |
||
184 | * @covers ::isBool |
||
185 | */ |
||
186 | public function testSetWithBankingCustomerIdInvalidParameter() |
||
190 | |||
191 | /** |
||
192 | * Tests the getCompleteReferenceNumber method |
||
193 | * Throws exception because of banking customer ID with reference number is longer than max allowed (26) |
||
194 | * |
||
195 | * @return void |
||
196 | * @covers ::setReferenceNumber |
||
197 | */ |
||
198 | public function testSetReferenceNumberLengthExceptionA() |
||
203 | |||
204 | /** |
||
205 | * Tests the getCompleteReferenceNumber method |
||
206 | * Throws exception because of banking customer ID with reference number is longer than max allowed (26) |
||
207 | * |
||
208 | * @return void |
||
209 | * @covers ::setReferenceNumber |
||
210 | */ |
||
211 | public function testSetReferenceNumberLengthExceptionB() |
||
217 | |||
218 | /** |
||
219 | * Tests the setBankingCustomerId method |
||
220 | * Throws exception because of banking customer ID is longer than max (10) |
||
221 | * |
||
222 | * @return void |
||
223 | * @covers ::setBankingCustomerId |
||
224 | */ |
||
225 | public function testsetBankingCustomerIdLengthExceptionA() |
||
230 | |||
231 | /** |
||
232 | * Tests the setBankingCustomerId method |
||
233 | * Throws exception because of banking customer ID is longer than expected by default (6) |
||
234 | * |
||
235 | * @return void |
||
236 | * @covers ::setBankingCustomerId |
||
237 | */ |
||
238 | public function testsetBankingCustomerIdLengthExceptionB() |
||
243 | |||
244 | /** |
||
245 | * Tests the setBankingCustomerId method |
||
246 | * Throws exception because of banking customer ID with reference number is longer than max allowed (26) |
||
247 | * |
||
248 | * @return void |
||
249 | * @covers ::setBankingCustomerId |
||
250 | */ |
||
251 | public function testsetBankingCustomerIdLengthExceptionC() |
||
257 | |||
258 | /** |
||
259 | * Tests the getCompleteReferenceNumber method |
||
260 | * |
||
261 | * @return void |
||
262 | * @covers ::getCompleteReferenceNumber |
||
263 | * @covers ::appendCheckDigit |
||
264 | * @covers ::breakStringIntoBlocks |
||
265 | * @covers ::modulo10 |
||
266 | */ |
||
267 | public function testGetCompleteReferenceNumber() |
||
369 | |||
370 | /** |
||
371 | * Tests the getCompleteReferenceNumber method with the reference number disabled |
||
372 | * |
||
373 | * @return void |
||
374 | * @expectedException \SwissPaymentSlip\SwissPaymentSlip\Exception\DisabledDataException |
||
375 | * @expectedExceptionMessage You are accessing the disabled reference number. You need to re-enable it first. |
||
376 | * @covers ::getCompleteReferenceNumber |
||
377 | * @covers ::getReferenceNumber |
||
378 | */ |
||
379 | public function testGetCompleteReferenceNumberWithReferenceNrDisabled() |
||
384 | |||
385 | /** |
||
386 | * Tests the getCodeLine method |
||
387 | * |
||
388 | * @return void |
||
389 | * @covers ::getCodeLine |
||
390 | * @covers ::modulo10 |
||
391 | * @covers ::getAccountDigits |
||
392 | */ |
||
393 | public function testGetCodeLine() |
||
492 | |||
493 | /** |
||
494 | * Tests the setNotForPayment method |
||
495 | * |
||
496 | * @return void |
||
497 | * @covers ::setNotForPayment |
||
498 | * @covers ::appendCheckDigit |
||
499 | * @covers ::getCompleteReferenceNumber |
||
500 | * @covers ::getCodeLine |
||
501 | * @covers ::getAccountDigits |
||
502 | */ |
||
503 | public function testSetNotForPayment() |
||
515 | |||
516 | /** |
||
517 | * Tests the setNotForPayment method when fields are disabled |
||
518 | * |
||
519 | * @return void |
||
520 | * @covers ::setNotForPayment |
||
521 | */ |
||
522 | public function testSetNotForPaymentDisabledFields() |
||
529 | } |
||
530 |
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: