1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Swiss Payment Slip |
4
|
|
|
* |
5
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php MIT License |
6
|
|
|
* @copyright 2012-2016 Some nice Swiss guys |
7
|
|
|
* @author Marc Würth [email protected] |
8
|
|
|
* @author Manuel Reinhard <[email protected]> |
9
|
|
|
* @author Peter Siska <[email protected]> |
10
|
|
|
* @link https://github.com/ravage84/SwissPaymentSlip/ |
11
|
|
|
*/ |
12
|
|
|
|
13
|
|
|
namespace SwissPaymentSlip\SwissPaymentSlip\Tests; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Tests for the PaymentSlip class |
17
|
|
|
* |
18
|
|
|
* @coversDefaultClass SwissPaymentSlip\SwissPaymentSlip\PaymentSlip |
19
|
|
|
*/ |
20
|
|
|
class PaymentSlipTest extends PaymentSlipTestCase |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* Setup a slip to test and some default and set attributes to test |
24
|
|
|
* |
25
|
|
|
* @return void |
26
|
|
|
*/ |
27
|
|
|
protected function setUp() |
28
|
|
|
{ |
29
|
|
|
$this->slipData = new TestablePaymentSlipData(); |
30
|
|
|
$this->paymentSlip = new TestablePaymentSlip($this->slipData); |
31
|
|
|
|
32
|
|
|
$attributes = array(); |
33
|
|
|
$attributes['PosX'] = 0; |
34
|
|
|
$attributes['PosY'] = 0; |
35
|
|
|
$attributes['Width'] = 0; |
36
|
|
|
$attributes['Height'] = 0; |
37
|
|
|
$attributes['Background'] = 'transparent'; |
38
|
|
|
$attributes['FontFamily'] = 'Helvetica'; |
39
|
|
|
$attributes['FontSize'] = '10'; |
40
|
|
|
$attributes['FontColor'] = '#000'; |
41
|
|
|
$attributes['LineHeight'] = 4; |
42
|
|
|
$attributes['TextAlign'] = 'L'; |
43
|
|
|
|
44
|
|
|
$this->defaultAttributes = $attributes; |
45
|
|
|
|
46
|
|
|
$attributes = array(); |
47
|
|
|
$attributes['PosX'] = 123; |
48
|
|
|
$attributes['PosY'] = 456; |
49
|
|
|
$attributes['Width'] = 987; |
50
|
|
|
$attributes['Height'] = 654; |
51
|
|
|
$attributes['Background'] = '#123456'; |
52
|
|
|
$attributes['FontFamily'] = 'Courier'; |
53
|
|
|
$attributes['FontSize'] = '1'; |
54
|
|
|
$attributes['FontColor'] = '#654321'; |
55
|
|
|
$attributes['LineHeight'] = '15'; |
56
|
|
|
$attributes['TextAlign'] = 'C'; |
57
|
|
|
|
58
|
|
|
$this->setAttributes = $attributes; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Tests the constructor when setting the position |
63
|
|
|
* |
64
|
|
|
* @return void |
65
|
|
|
* @covers ::__construct |
66
|
|
|
*/ |
67
|
|
|
public function testConstructSetPosition() |
68
|
|
|
{ |
69
|
|
|
// Do not set position explicitly |
70
|
|
|
$slip = new TestablePaymentSlip($this->slipData); |
71
|
|
|
$this->assertEquals(0, $slip->getSlipPosX()); |
72
|
|
|
$this->assertEquals(191, $slip->getSlipPosY()); |
73
|
|
|
|
74
|
|
|
// Set X and Y position |
75
|
|
|
$slip = new TestablePaymentSlip($this->slipData, 100, 200); |
76
|
|
|
$this->assertEquals(100, $slip->getSlipPosX()); |
77
|
|
|
$this->assertEquals(200, $slip->getSlipPosY()); |
78
|
|
|
|
79
|
|
|
// Set X position only |
80
|
|
|
$slip = new TestablePaymentSlip($this->slipData, 50); |
81
|
|
|
$this->assertEquals(50, $slip->getSlipPosX()); |
82
|
|
|
$this->assertEquals(191, $slip->getSlipPosY()); |
83
|
|
|
|
84
|
|
|
// Set X position only |
85
|
|
|
$slip = new TestablePaymentSlip($this->slipData, null, 150); |
86
|
|
|
$this->assertEquals(0, $slip->getSlipPosX()); |
87
|
|
|
$this->assertEquals(150, $slip->getSlipPosY()); |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* Tests the getPaymentSlipData method |
92
|
|
|
* |
93
|
|
|
* @return void |
94
|
|
|
* @covers ::getPaymentSlipData |
95
|
|
|
*/ |
96
|
|
|
public function testGetPaymentSlipDataIsInstanceOf() |
97
|
|
|
{ |
98
|
|
|
$this->assertInstanceOf( |
99
|
|
|
'SwissPaymentSlip\SwissPaymentSlip\PaymentSlipData', |
100
|
|
|
$this->paymentSlip->getPaymentSlipData() |
101
|
|
|
); |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* Tests setting the slip position |
106
|
|
|
* |
107
|
|
|
* @return void |
108
|
|
|
* @covers ::setSlipPosition |
109
|
|
|
* @covers ::setSlipPosX |
110
|
|
|
* @covers ::setSlipPosY |
111
|
|
|
* @covers ::getSlipPosX |
112
|
|
|
* @covers ::getSlipPosY |
113
|
|
|
*/ |
114
|
|
|
public function testSetSlipPosition() |
115
|
|
|
{ |
116
|
|
|
// Test the default values |
117
|
|
|
$this->assertEquals(0, $this->paymentSlip->getSlipPosX()); |
118
|
|
|
$this->assertEquals(191, $this->paymentSlip->getSlipPosY()); |
119
|
|
|
|
120
|
|
|
// Set both |
121
|
|
|
$returned = $this->paymentSlip->setSlipPosition(200, 100); |
122
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
123
|
|
|
$this->assertEquals(200, $this->paymentSlip->getSlipPosX()); |
124
|
|
|
$this->assertEquals(100, $this->paymentSlip->getSlipPosY()); |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* Tests the setSlipPosition method with an invalid first parameter |
129
|
|
|
* |
130
|
|
|
* @return void |
131
|
|
|
* @expectedException \InvalidArgumentException |
132
|
|
|
* @expectedExceptionMessage $slipPosX is neither an integer nor a float. |
133
|
|
|
* @covers ::setSlipPosition |
134
|
|
|
* @covers ::isIntOrFloat |
135
|
|
|
*/ |
136
|
|
|
public function testSetSlipPositionFirstParameterInvalid() |
137
|
|
|
{ |
138
|
|
|
$this->paymentSlip->setSlipPosition('A', 150); |
|
|
|
|
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* Tests the setSlipPosition method with an invalid second parameter |
143
|
|
|
* |
144
|
|
|
* @return void |
145
|
|
|
* @expectedException \InvalidArgumentException |
146
|
|
|
* @expectedExceptionMessage $slipPosY is neither an integer nor a float. |
147
|
|
|
* @covers ::setSlipPosition |
148
|
|
|
* @covers ::isIntOrFloat |
149
|
|
|
*/ |
150
|
|
|
public function testSetSlipPositionSecondParameterInvalid() |
151
|
|
|
{ |
152
|
|
|
$this->paymentSlip->setSlipPosition(150, 'B'); |
|
|
|
|
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
/** |
156
|
|
|
* Tests setting the slip size |
157
|
|
|
* |
158
|
|
|
* @return void |
159
|
|
|
* @covers ::setSlipSize |
160
|
|
|
* @covers ::setSlipWidth |
161
|
|
|
* @covers ::setSlipHeight |
162
|
|
|
* @covers ::getSlipWidth |
163
|
|
|
* @covers ::getSlipHeight |
164
|
|
|
*/ |
165
|
|
|
public function testSetSlipSize() |
166
|
|
|
{ |
167
|
|
|
// Test the default values |
168
|
|
|
$this->assertEquals(210, $this->paymentSlip->getSlipWidth()); |
169
|
|
|
$this->assertEquals(106, $this->paymentSlip->getSlipHeight()); |
170
|
|
|
|
171
|
|
|
$returned = $this->paymentSlip->setSlipSize(250, 150); |
172
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
173
|
|
|
$this->assertEquals(250, $this->paymentSlip->getSlipWidth()); |
174
|
|
|
$this->assertEquals(150, $this->paymentSlip->getSlipHeight()); |
175
|
|
|
} |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* Tests the setSlipSize method with an invalid first parameter |
179
|
|
|
* |
180
|
|
|
* @return void |
181
|
|
|
* @expectedException \InvalidArgumentException |
182
|
|
|
* @expectedExceptionMessage $slipWidth is neither an integer nor a float. |
183
|
|
|
* @covers ::setSlipSize |
184
|
|
|
* @covers ::isIntOrFloat |
185
|
|
|
*/ |
186
|
|
|
public function testSetSlipSizeFirstParameterInvalid() |
187
|
|
|
{ |
188
|
|
|
$this->paymentSlip->setSlipSize('A', 150); |
|
|
|
|
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* Tests the setSlipSize method with an invalid second parameter |
193
|
|
|
* |
194
|
|
|
* @return void |
195
|
|
|
* @expectedException \InvalidArgumentException |
196
|
|
|
* @expectedExceptionMessage $slipHeight is neither an integer nor a float. |
197
|
|
|
* @covers ::setSlipSize |
198
|
|
|
* @covers ::isIntOrFloat |
199
|
|
|
*/ |
200
|
|
|
public function testSetSlipSizeSecondParameterInvalid() |
201
|
|
|
{ |
202
|
|
|
$this->paymentSlip->setSlipSize(150, 'B'); |
|
|
|
|
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
/** |
206
|
|
|
* Tests setting the slip background |
207
|
|
|
* |
208
|
|
|
* @return void |
209
|
|
|
* @covers ::setSlipBackground |
210
|
|
|
* @covers ::getSlipBackground |
211
|
|
|
*/ |
212
|
|
|
public function testSetSlipBackground() |
213
|
|
|
{ |
214
|
|
|
// Test with a RGB code |
215
|
|
|
$returned = $this->paymentSlip->setSlipBackground('#123456'); |
216
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
217
|
|
|
$this->assertEquals('#123456', $this->paymentSlip->getSlipBackground()); |
218
|
|
|
|
219
|
|
|
// Test with an image |
220
|
|
|
$this->paymentSlip->setSlipBackground(__DIR__.'/Resources/img/ezs_orange.gif'); |
221
|
|
|
$this->assertEquals(__DIR__.'/Resources/img/ezs_orange.gif', $this->paymentSlip->getSlipBackground()); |
222
|
|
|
} |
223
|
|
|
|
224
|
|
|
/** |
225
|
|
|
* Tests the default attributes of the left bank element |
226
|
|
|
* |
227
|
|
|
* @return void |
228
|
|
|
* @covers ::setDefaults |
229
|
|
|
*/ |
230
|
|
|
public function testBankLeftAttrDefaultValues() |
231
|
|
|
{ |
232
|
|
|
$attributes = $this->paymentSlip->getBankLeftAttr(); |
233
|
|
|
|
234
|
|
|
$expectedAttributes = $this->defaultAttributes; |
235
|
|
|
|
236
|
|
|
$expectedAttributes['PosX'] = 3; |
237
|
|
|
$expectedAttributes['PosY'] = 8; |
238
|
|
|
$expectedAttributes['Width'] = 50; |
239
|
|
|
$expectedAttributes['Height'] = 4; |
240
|
|
|
|
241
|
|
|
$this->assertEquals($expectedAttributes, $attributes); |
242
|
|
|
} |
243
|
|
|
|
244
|
|
|
/** |
245
|
|
|
* Tests the default attributes of the right bank element |
246
|
|
|
* |
247
|
|
|
* @return void |
248
|
|
|
* @covers ::setDefaults |
249
|
|
|
*/ |
250
|
|
|
public function testBankRightAttrDefaultValues() |
251
|
|
|
{ |
252
|
|
|
$attributes = $this->paymentSlip->getBankRightAttr(); |
253
|
|
|
|
254
|
|
|
$expectedAttributes = $this->defaultAttributes; |
255
|
|
|
|
256
|
|
|
$expectedAttributes['PosX'] = 66; |
257
|
|
|
$expectedAttributes['PosY'] = 8; |
258
|
|
|
$expectedAttributes['Width'] = 50; |
259
|
|
|
$expectedAttributes['Height'] = 4; |
260
|
|
|
|
261
|
|
|
$this->assertEquals($expectedAttributes, $attributes); |
262
|
|
|
} |
263
|
|
|
|
264
|
|
|
/** |
265
|
|
|
* Tests the default attributes of the left recipient element |
266
|
|
|
* |
267
|
|
|
* @return void |
268
|
|
|
* @covers ::setDefaults |
269
|
|
|
*/ |
270
|
|
|
public function testRecipientLeftAttrDefaultValues() |
271
|
|
|
{ |
272
|
|
|
$attributes = $this->paymentSlip->getRecipientLeftAttr(); |
273
|
|
|
|
274
|
|
|
$expectedAttributes = $this->defaultAttributes; |
275
|
|
|
|
276
|
|
|
$expectedAttributes['PosX'] = 3; |
277
|
|
|
$expectedAttributes['PosY'] = 23; |
278
|
|
|
$expectedAttributes['Width'] = 50; |
279
|
|
|
$expectedAttributes['Height'] = 4; |
280
|
|
|
|
281
|
|
|
$this->assertEquals($expectedAttributes, $attributes); |
282
|
|
|
} |
283
|
|
|
|
284
|
|
|
/** |
285
|
|
|
* Tests the default attributes of the right recipient element |
286
|
|
|
* |
287
|
|
|
* @return void |
288
|
|
|
* @covers ::setDefaults |
289
|
|
|
*/ |
290
|
|
|
public function testRecipientRightAttrDefaultValues() |
291
|
|
|
{ |
292
|
|
|
$attributes = $this->paymentSlip->getRecipientRightAttr(); |
293
|
|
|
|
294
|
|
|
$expectedAttributes = $this->defaultAttributes; |
295
|
|
|
|
296
|
|
|
$expectedAttributes['PosX'] = 66; |
297
|
|
|
$expectedAttributes['PosY'] = 23; |
298
|
|
|
$expectedAttributes['Width'] = 50; |
299
|
|
|
$expectedAttributes['Height'] = 4; |
300
|
|
|
|
301
|
|
|
$this->assertEquals($expectedAttributes, $attributes); |
302
|
|
|
} |
303
|
|
|
|
304
|
|
|
/** |
305
|
|
|
* Tests the default attributes of the left account element |
306
|
|
|
* |
307
|
|
|
* @return void |
308
|
|
|
* @covers ::setDefaults |
309
|
|
|
*/ |
310
|
|
|
public function testAccountLeftAttrDefaultValues() |
311
|
|
|
{ |
312
|
|
|
$attributes = $this->paymentSlip->getAccountLeftAttr(); |
313
|
|
|
|
314
|
|
|
$expectedAttributes = $this->defaultAttributes; |
315
|
|
|
|
316
|
|
|
$expectedAttributes['PosX'] = 27; |
317
|
|
|
$expectedAttributes['PosY'] = 43; |
318
|
|
|
$expectedAttributes['Width'] = 30; |
319
|
|
|
$expectedAttributes['Height'] = 4; |
320
|
|
|
|
321
|
|
|
$this->assertEquals($expectedAttributes, $attributes); |
322
|
|
|
} |
323
|
|
|
|
324
|
|
|
/** |
325
|
|
|
* Tests the default attributes of the right account element |
326
|
|
|
* |
327
|
|
|
* @return void |
328
|
|
|
* @covers ::setDefaults |
329
|
|
|
*/ |
330
|
|
|
public function testAccountRightAttrDefaultValues() |
331
|
|
|
{ |
332
|
|
|
$attributes = $this->paymentSlip->getAccountRightAttr(); |
333
|
|
|
|
334
|
|
|
$expectedAttributes = $this->defaultAttributes; |
335
|
|
|
|
336
|
|
|
$expectedAttributes['PosX'] = 90; |
337
|
|
|
$expectedAttributes['PosY'] = 43; |
338
|
|
|
$expectedAttributes['Width'] = 30; |
339
|
|
|
$expectedAttributes['Height'] = 4; |
340
|
|
|
|
341
|
|
|
$this->assertEquals($expectedAttributes, $attributes); |
342
|
|
|
} |
343
|
|
|
|
344
|
|
|
/** |
345
|
|
|
* Tests the default attributes of the left francs amount element |
346
|
|
|
* |
347
|
|
|
* @return void |
348
|
|
|
* @covers ::setDefaults |
349
|
|
|
*/ |
350
|
|
|
public function testAmountFrancsLeftAttrDefaultValues() |
351
|
|
|
{ |
352
|
|
|
$attributes = $this->paymentSlip->getAmountFrancsLeftAttr(); |
353
|
|
|
|
354
|
|
|
$expectedAttributes = $this->defaultAttributes; |
355
|
|
|
|
356
|
|
|
$expectedAttributes['PosX'] = 5; |
357
|
|
|
$expectedAttributes['PosY'] = 50.5; |
358
|
|
|
$expectedAttributes['Width'] = 35; |
359
|
|
|
$expectedAttributes['Height'] = 4; |
360
|
|
|
$expectedAttributes['TextAlign'] = 'R'; |
361
|
|
|
|
362
|
|
|
$this->assertEquals($expectedAttributes, $attributes); |
363
|
|
|
} |
364
|
|
|
|
365
|
|
|
/** |
366
|
|
|
* Tests the default attributes of the right francs amount element |
367
|
|
|
* |
368
|
|
|
* @return void |
369
|
|
|
* @covers ::setDefaults |
370
|
|
|
*/ |
371
|
|
|
public function testAmountFrancsRightAttrDefaultValues() |
372
|
|
|
{ |
373
|
|
|
$attributes = $this->paymentSlip->getAmountFrancsRightAttr(); |
374
|
|
|
|
375
|
|
|
$expectedAttributes = $this->defaultAttributes; |
376
|
|
|
|
377
|
|
|
$expectedAttributes['PosX'] = 66; |
378
|
|
|
$expectedAttributes['PosY'] = 50.5; |
379
|
|
|
$expectedAttributes['Width'] = 35; |
380
|
|
|
$expectedAttributes['Height'] = 4; |
381
|
|
|
$expectedAttributes['TextAlign'] = 'R'; |
382
|
|
|
|
383
|
|
|
$this->assertEquals($expectedAttributes, $attributes); |
384
|
|
|
} |
385
|
|
|
|
386
|
|
|
/** |
387
|
|
|
* Tests the default attributes of the left cents amount element |
388
|
|
|
* |
389
|
|
|
* @return void |
390
|
|
|
* @covers ::setDefaults |
391
|
|
|
*/ |
392
|
|
|
public function testAmountCentsLeftAttrDefaultValues() |
393
|
|
|
{ |
394
|
|
|
$attributes = $this->paymentSlip->getAmountCentsLeftAttr(); |
395
|
|
|
|
396
|
|
|
$expectedAttributes = $this->defaultAttributes; |
397
|
|
|
|
398
|
|
|
$expectedAttributes['PosX'] = 50; |
399
|
|
|
$expectedAttributes['PosY'] = 50.5; |
400
|
|
|
$expectedAttributes['Width'] = 6; |
401
|
|
|
$expectedAttributes['Height'] = 4; |
402
|
|
|
|
403
|
|
|
$this->assertEquals($expectedAttributes, $attributes); |
404
|
|
|
} |
405
|
|
|
|
406
|
|
|
/** |
407
|
|
|
* Tests the default attributes of the right cents amount element |
408
|
|
|
* |
409
|
|
|
* @return void |
410
|
|
|
* @covers ::setDefaults |
411
|
|
|
*/ |
412
|
|
|
public function testAmountCentsRightAttrDefaultValues() |
413
|
|
|
{ |
414
|
|
|
$attributes = $this->paymentSlip->getAmountCentsRightAttr(); |
415
|
|
|
|
416
|
|
|
$expectedAttributes = $this->defaultAttributes; |
417
|
|
|
|
418
|
|
|
$expectedAttributes['PosX'] = 111; |
419
|
|
|
$expectedAttributes['PosY'] = 50.5; |
420
|
|
|
$expectedAttributes['Width'] = 6; |
421
|
|
|
$expectedAttributes['Height'] = 4; |
422
|
|
|
|
423
|
|
|
$this->assertEquals($expectedAttributes, $attributes); |
424
|
|
|
} |
425
|
|
|
|
426
|
|
|
/** |
427
|
|
|
* Tests the default attributes of the left payer element |
428
|
|
|
* |
429
|
|
|
* @return void |
430
|
|
|
* @covers ::setDefaults |
431
|
|
|
*/ |
432
|
|
|
public function testPayerLeftAttrDefaultValues() |
433
|
|
|
{ |
434
|
|
|
$attributes = $this->paymentSlip->getPayerLeftAttr(); |
435
|
|
|
|
436
|
|
|
$expectedAttributes = $this->defaultAttributes; |
437
|
|
|
|
438
|
|
|
$expectedAttributes['PosX'] = 3; |
439
|
|
|
$expectedAttributes['PosY'] = 65; |
440
|
|
|
$expectedAttributes['Width'] = 50; |
441
|
|
|
$expectedAttributes['Height'] = 4; |
442
|
|
|
|
443
|
|
|
$this->assertEquals($expectedAttributes, $attributes); |
444
|
|
|
} |
445
|
|
|
|
446
|
|
|
/** |
447
|
|
|
* Tests the default attributes of the right payer element |
448
|
|
|
* |
449
|
|
|
* @return void |
450
|
|
|
* @covers ::setDefaults |
451
|
|
|
*/ |
452
|
|
|
public function testPayerRightAttrDefaultValues() |
453
|
|
|
{ |
454
|
|
|
$attributes = $this->paymentSlip->getPayerRightAttr(); |
455
|
|
|
|
456
|
|
|
$expectedAttributes = $this->defaultAttributes; |
457
|
|
|
|
458
|
|
|
$expectedAttributes['PosX'] = 125; |
459
|
|
|
$expectedAttributes['PosY'] = 48; |
460
|
|
|
$expectedAttributes['Width'] = 50; |
461
|
|
|
$expectedAttributes['Height'] = 4; |
462
|
|
|
|
463
|
|
|
$this->assertEquals($expectedAttributes, $attributes); |
464
|
|
|
} |
465
|
|
|
|
466
|
|
|
/** |
467
|
|
|
* Tests the default background |
468
|
|
|
* |
469
|
|
|
* @return void |
470
|
|
|
* @covers ::setDefaults |
471
|
|
|
*/ |
472
|
|
|
public function testSlipBackgroundDefaultValues() |
473
|
|
|
{ |
474
|
|
|
$this->assertEquals(null, basename($this->paymentSlip->getSlipBackground())); |
475
|
|
|
} |
476
|
|
|
|
477
|
|
|
/** |
478
|
|
|
* Tests the setBankLeftAttr method |
479
|
|
|
* |
480
|
|
|
* @return void |
481
|
|
|
* @covers ::setBankLeftAttr |
482
|
|
|
* @covers ::setAttributes |
483
|
|
|
* @covers ::getBankLeftAttr |
484
|
|
|
*/ |
485
|
|
|
public function testSetBankLeftAttr() |
486
|
|
|
{ |
487
|
|
|
$returned = $this->paymentSlip->setBankLeftAttr(123, 456, 987, 654, '#123456', 'Courier', '1', '#654321', '15', 'C'); |
|
|
|
|
488
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
489
|
|
|
$this->assertEquals($this->setAttributes, $this->paymentSlip->getBankLeftAttr()); |
490
|
|
|
} |
491
|
|
|
|
492
|
|
|
/** |
493
|
|
|
* Tests the setBankRightAttr method |
494
|
|
|
* |
495
|
|
|
* @return void |
496
|
|
|
* @covers ::setBankRightAttr |
497
|
|
|
* @covers ::setAttributes |
498
|
|
|
* @covers ::getBankRightAttr |
499
|
|
|
*/ |
500
|
|
|
public function testSetBankRightAttr() |
501
|
|
|
{ |
502
|
|
|
$returned = $this->paymentSlip->setBankRightAttr(123, 456, 987, 654, '#123456', 'Courier', '1', '#654321', '15', 'C'); |
|
|
|
|
503
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
504
|
|
|
$this->assertEquals($this->setAttributes, $this->paymentSlip->getBankRightAttr()); |
505
|
|
|
} |
506
|
|
|
|
507
|
|
|
/** |
508
|
|
|
* Tests the setRecipientLeftAttr method |
509
|
|
|
* |
510
|
|
|
* @return void |
511
|
|
|
* @covers ::setRecipientLeftAttr |
512
|
|
|
* @covers ::setAttributes |
513
|
|
|
* @covers ::getRecipientLeftAttr |
514
|
|
|
*/ |
515
|
|
|
public function testSetRecipientLeftAttr() |
516
|
|
|
{ |
517
|
|
|
$returned = $this->paymentSlip->setRecipientLeftAttr(123, 456, 987, 654, '#123456', 'Courier', '1', '#654321', '15', 'C'); |
|
|
|
|
518
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
519
|
|
|
$this->assertEquals($this->setAttributes, $this->paymentSlip->getRecipientLeftAttr()); |
520
|
|
|
} |
521
|
|
|
|
522
|
|
|
/** |
523
|
|
|
* Tests the setRecipientRightAttr method |
524
|
|
|
* |
525
|
|
|
* @return void |
526
|
|
|
* @covers ::setRecipientRightAttr |
527
|
|
|
* @covers ::setAttributes |
528
|
|
|
* @covers ::getRecipientRightAttr |
529
|
|
|
*/ |
530
|
|
|
public function testSetRecipientRightAttr() |
531
|
|
|
{ |
532
|
|
|
$returned = $this->paymentSlip->setRecipientRightAttr(123, 456, 987, 654, '#123456', 'Courier', '1', '#654321', '15', 'C'); |
|
|
|
|
533
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
534
|
|
|
$this->assertEquals($this->setAttributes, $this->paymentSlip->getRecipientRightAttr()); |
535
|
|
|
} |
536
|
|
|
|
537
|
|
|
/** |
538
|
|
|
* Tests the setAccountLeftAttr method |
539
|
|
|
* |
540
|
|
|
* @return void |
541
|
|
|
* @covers ::setAccountLeftAttr |
542
|
|
|
* @covers ::setAttributes |
543
|
|
|
* @covers ::getAccountLeftAttr |
544
|
|
|
*/ |
545
|
|
|
public function testSetAccountLeftAttr() |
546
|
|
|
{ |
547
|
|
|
$returned = $this->paymentSlip->setAccountLeftAttr(123, 456, 987, 654, '#123456', 'Courier', '1', '#654321', '15', 'C'); |
|
|
|
|
548
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
549
|
|
|
$this->assertEquals($this->setAttributes, $this->paymentSlip->getAccountLeftAttr()); |
550
|
|
|
} |
551
|
|
|
|
552
|
|
|
/** |
553
|
|
|
* Tests the setAccountRightAttr method |
554
|
|
|
* |
555
|
|
|
* @return void |
556
|
|
|
* @covers ::setAccountRightAttr |
557
|
|
|
* @covers ::setAttributes |
558
|
|
|
* @covers ::getAccountRightAttr |
559
|
|
|
*/ |
560
|
|
|
public function testSetAccountRightAttr() |
561
|
|
|
{ |
562
|
|
|
$returned = $this->paymentSlip->setAccountRightAttr(123, 456, 987, 654, '#123456', 'Courier', '1', '#654321', '15', 'C'); |
|
|
|
|
563
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
564
|
|
|
$this->assertEquals($this->setAttributes, $this->paymentSlip->getAccountRightAttr()); |
565
|
|
|
} |
566
|
|
|
|
567
|
|
|
/** |
568
|
|
|
* Tests the setAmountFrancsLeftAttr method |
569
|
|
|
* |
570
|
|
|
* @return void |
571
|
|
|
* @covers ::setAmountFrancsLeftAttr |
572
|
|
|
* @covers ::setAttributes |
573
|
|
|
* @covers ::getAmountFrancsLeftAttr |
574
|
|
|
*/ |
575
|
|
|
public function testSetAmountFrancsLeftAttr() |
576
|
|
|
{ |
577
|
|
|
$returned = $this->paymentSlip->setAmountFrancsLeftAttr(123, 456, 987, 654, '#123456', 'Courier', '1', '#654321', '15', 'C'); |
|
|
|
|
578
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
579
|
|
|
$this->assertEquals($this->setAttributes, $this->paymentSlip->getAmountFrancsLeftAttr()); |
580
|
|
|
} |
581
|
|
|
|
582
|
|
|
/** |
583
|
|
|
* Tests the setAmountCentsLeftAttr method |
584
|
|
|
* |
585
|
|
|
* @return void |
586
|
|
|
* @covers ::setAmountCentsLeftAttr |
587
|
|
|
* @covers ::setAttributes |
588
|
|
|
* @covers ::getAmountCentsLeftAttr |
589
|
|
|
*/ |
590
|
|
|
public function testSetAmountCentsLeftAttr() |
591
|
|
|
{ |
592
|
|
|
$returned = $this->paymentSlip->setAmountCentsLeftAttr(123, 456, 987, 654, '#123456', 'Courier', '1', '#654321', '15', 'C'); |
|
|
|
|
593
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
594
|
|
|
$this->assertEquals($this->setAttributes, $this->paymentSlip->getAmountCentsLeftAttr()); |
595
|
|
|
} |
596
|
|
|
|
597
|
|
|
/** |
598
|
|
|
* Tests the setAmountCentsRightAttr method |
599
|
|
|
* |
600
|
|
|
* @return void |
601
|
|
|
* @covers ::setAmountCentsRightAttr |
602
|
|
|
* @covers ::setAttributes |
603
|
|
|
* @covers ::getAmountCentsRightAttr |
604
|
|
|
*/ |
605
|
|
|
public function testSetAmountCentsRightAttr() |
606
|
|
|
{ |
607
|
|
|
$returned = $this->paymentSlip->setAmountCentsRightAttr(123, 456, 987, 654, '#123456', 'Courier', '1', '#654321', '15', 'C'); |
|
|
|
|
608
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
609
|
|
|
$this->assertEquals($this->setAttributes, $this->paymentSlip->getAmountCentsRightAttr()); |
610
|
|
|
} |
611
|
|
|
|
612
|
|
|
/** |
613
|
|
|
* Tests the setAmountFrancsRightAttr method |
614
|
|
|
* |
615
|
|
|
* @return void |
616
|
|
|
* @covers ::setAmountFrancsRightAttr |
617
|
|
|
* @covers ::setAttributes |
618
|
|
|
* @covers ::getAmountFrancsRightAttr |
619
|
|
|
*/ |
620
|
|
|
public function testSetAmountFrancsRightAttr() |
621
|
|
|
{ |
622
|
|
|
$returned = $this->paymentSlip->setAmountFrancsRightAttr(123, 456, 987, 654, '#123456', 'Courier', '1', '#654321', '15', 'C'); |
|
|
|
|
623
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
624
|
|
|
$this->assertEquals($this->setAttributes, $this->paymentSlip->getAmountFrancsRightAttr()); |
625
|
|
|
} |
626
|
|
|
|
627
|
|
|
/** |
628
|
|
|
* Tests the setPayerLeftAttr method |
629
|
|
|
* |
630
|
|
|
* @return void |
631
|
|
|
* @covers ::setPayerLeftAttr |
632
|
|
|
* @covers ::setAttributes |
633
|
|
|
* @covers ::getPayerLeftAttr |
634
|
|
|
*/ |
635
|
|
|
public function testSetPayerLeftAttr() |
636
|
|
|
{ |
637
|
|
|
$returned = $this->paymentSlip->setPayerLeftAttr(123, 456, 987, 654, '#123456', 'Courier', '1', '#654321', '15', 'C'); |
|
|
|
|
638
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
639
|
|
|
$this->assertEquals($this->setAttributes, $this->paymentSlip->getPayerLeftAttr()); |
640
|
|
|
} |
641
|
|
|
|
642
|
|
|
/** |
643
|
|
|
* Tests the setPayerRightAttr method |
644
|
|
|
* |
645
|
|
|
* @return void |
646
|
|
|
* @covers ::setPayerRightAttr |
647
|
|
|
* @covers ::setAttributes |
648
|
|
|
* @covers ::getPayerRightAttr |
649
|
|
|
*/ |
650
|
|
|
public function testSetPayerRightAttr() |
651
|
|
|
{ |
652
|
|
|
$returned = $this->paymentSlip->setPayerRightAttr(123, 456, 987, 654, '#123456', 'Courier', '1', '#654321', '15', 'C'); |
|
|
|
|
653
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
654
|
|
|
$this->assertEquals($this->setAttributes, $this->paymentSlip->getPayerRightAttr()); |
655
|
|
|
} |
656
|
|
|
|
657
|
|
|
/** |
658
|
|
|
* Tests the setDisplayBackground method |
659
|
|
|
* |
660
|
|
|
* @return void |
661
|
|
|
* @covers ::setDisplayBackground |
662
|
|
|
* @covers ::getDisplayBackground |
663
|
|
|
* @covers ::isBool |
664
|
|
|
*/ |
665
|
|
|
public function testSetDisplayBackground() |
666
|
|
|
{ |
667
|
|
|
// Test the default value |
668
|
|
|
$this->assertTrue($this->paymentSlip->getDisplayBackground()); |
669
|
|
|
|
670
|
|
|
// Disable feature, also check for returned instance |
671
|
|
|
$returned = $this->paymentSlip->setDisplayBackground(false); |
672
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
673
|
|
|
$this->assertFalse($this->paymentSlip->getDisplayBackground()); |
674
|
|
|
|
675
|
|
|
// Re-enable the feature |
676
|
|
|
$this->paymentSlip->setDisplayBackground(); |
677
|
|
|
$this->assertTrue($this->paymentSlip->getDisplayBackground()); |
678
|
|
|
} |
679
|
|
|
|
680
|
|
|
/** |
681
|
|
|
* Tests the setDisplayBackground method with an invalid parameter |
682
|
|
|
* |
683
|
|
|
* @return void |
684
|
|
|
* @expectedException \InvalidArgumentException |
685
|
|
|
* @expectedExceptionMessage $displayBackground is not a boolean. |
686
|
|
|
* @covers ::setDisplayBackground |
687
|
|
|
* @covers ::isBool |
688
|
|
|
*/ |
689
|
|
|
public function testSetDisplayBackgroundInvalidParameter() |
690
|
|
|
{ |
691
|
|
|
$this->paymentSlip->setDisplayBackground('true'); |
|
|
|
|
692
|
|
|
} |
693
|
|
|
|
694
|
|
|
/** |
695
|
|
|
* Tests the setDisplayBank method |
696
|
|
|
* |
697
|
|
|
* @return void |
698
|
|
|
* @covers ::setDisplayBank |
699
|
|
|
* @covers ::getDisplayBank |
700
|
|
|
* @covers ::isBool |
701
|
|
|
*/ |
702
|
|
|
public function testSetDisplayBank() |
703
|
|
|
{ |
704
|
|
|
// Test the default value |
705
|
|
|
$this->assertTrue($this->paymentSlip->getDisplayBank()); |
706
|
|
|
|
707
|
|
|
// Disable feature, also check for returned instance |
708
|
|
|
$returned = $this->paymentSlip->setDisplayBank(false); |
709
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
710
|
|
|
$this->assertFalse($this->paymentSlip->getDisplayBank()); |
711
|
|
|
|
712
|
|
|
// Re-enable the feature |
713
|
|
|
$this->paymentSlip->setDisplayBank(); |
714
|
|
|
$this->assertTrue($this->paymentSlip->getDisplayBank()); |
715
|
|
|
|
716
|
|
|
// Check if the data is disabled |
717
|
|
|
$this->paymentSlip->getPaymentSlipData()->setWithBank(false); |
718
|
|
|
$this->assertFalse($this->paymentSlip->getDisplayBank()); |
719
|
|
|
} |
720
|
|
|
|
721
|
|
|
/** |
722
|
|
|
* Tests the setDisplayBank method with an invalid parameter |
723
|
|
|
* |
724
|
|
|
* @return void |
725
|
|
|
* @expectedException \InvalidArgumentException |
726
|
|
|
* @expectedExceptionMessage $displayBank is not a boolean. |
727
|
|
|
* @covers ::setDisplayBank |
728
|
|
|
* @covers ::isBool |
729
|
|
|
*/ |
730
|
|
|
public function testSetDisplayBankInvalidParameter() |
731
|
|
|
{ |
732
|
|
|
$this->paymentSlip->setDisplayBank('true'); |
|
|
|
|
733
|
|
|
} |
734
|
|
|
|
735
|
|
|
/** |
736
|
|
|
* Tests the setDisplayAccount method |
737
|
|
|
* |
738
|
|
|
* @return void |
739
|
|
|
* @covers ::setDisplayAccount |
740
|
|
|
* @covers ::getDisplayAccount |
741
|
|
|
* @covers ::isBool |
742
|
|
|
*/ |
743
|
|
|
public function testSetDisplayAccount() |
744
|
|
|
{ |
745
|
|
|
// Test the default value |
746
|
|
|
$this->assertTrue($this->paymentSlip->getDisplayAccount()); |
747
|
|
|
|
748
|
|
|
// Disable feature, also check for returned instance |
749
|
|
|
$returned = $this->paymentSlip->setDisplayAccount(false); |
750
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
751
|
|
|
$this->assertFalse($this->paymentSlip->getDisplayAccount()); |
752
|
|
|
|
753
|
|
|
// Re-enable the feature |
754
|
|
|
$this->paymentSlip->setDisplayAccount(); |
755
|
|
|
$this->assertTrue($this->paymentSlip->getDisplayAccount()); |
756
|
|
|
|
757
|
|
|
// Check if the data is disabled |
758
|
|
|
$this->paymentSlip->getPaymentSlipData()->setWithAccountNumber(false); |
759
|
|
|
$this->assertFalse($this->paymentSlip->getDisplayAccount()); |
760
|
|
|
} |
761
|
|
|
|
762
|
|
|
/** |
763
|
|
|
* Tests the setDisplayAccount method with an invalid parameter |
764
|
|
|
* |
765
|
|
|
* @return void |
766
|
|
|
* @expectedException \InvalidArgumentException |
767
|
|
|
* @expectedExceptionMessage $displayAccount is not a boolean. |
768
|
|
|
* @covers ::setDisplayAccount |
769
|
|
|
* @covers ::isBool |
770
|
|
|
*/ |
771
|
|
|
public function testSetDisplayAccountInvalidParameter() |
772
|
|
|
{ |
773
|
|
|
$this->paymentSlip->setDisplayAccount('true'); |
|
|
|
|
774
|
|
|
} |
775
|
|
|
|
776
|
|
|
/** |
777
|
|
|
* Tests the setDisplayRecipient method |
778
|
|
|
* |
779
|
|
|
* @return void |
780
|
|
|
* @covers ::setDisplayRecipient |
781
|
|
|
* @covers ::getDisplayRecipient |
782
|
|
|
* @covers ::isBool |
783
|
|
|
*/ |
784
|
|
|
public function testSetDisplayRecipient() |
785
|
|
|
{ |
786
|
|
|
// Test the default value |
787
|
|
|
$this->assertTrue($this->paymentSlip->getDisplayRecipient()); |
788
|
|
|
|
789
|
|
|
// Disable feature, also check for returned instance |
790
|
|
|
$returned = $this->paymentSlip->setDisplayRecipient(false); |
791
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
792
|
|
|
$this->assertFalse($this->paymentSlip->getDisplayRecipient()); |
793
|
|
|
|
794
|
|
|
// Re-enable the feature |
795
|
|
|
$this->paymentSlip->setDisplayRecipient(); |
796
|
|
|
$this->assertTrue($this->paymentSlip->getDisplayRecipient()); |
797
|
|
|
|
798
|
|
|
// Check if the data is disabled |
799
|
|
|
$this->paymentSlip->getPaymentSlipData()->setWithRecipient(false); |
800
|
|
|
$this->assertFalse($this->paymentSlip->getDisplayRecipient()); |
801
|
|
|
} |
802
|
|
|
|
803
|
|
|
/** |
804
|
|
|
* Tests the setDisplayRecipient method with an invalid parameter |
805
|
|
|
* |
806
|
|
|
* @return void |
807
|
|
|
* @expectedException \InvalidArgumentException |
808
|
|
|
* @expectedExceptionMessage $displayRecipient is not a boolean. |
809
|
|
|
* @covers ::setDisplayRecipient |
810
|
|
|
* @covers ::isBool |
811
|
|
|
*/ |
812
|
|
|
public function testSetDisplayRecipientInvalidParameter() |
813
|
|
|
{ |
814
|
|
|
$this->paymentSlip->setDisplayRecipient('true'); |
|
|
|
|
815
|
|
|
} |
816
|
|
|
|
817
|
|
|
/** |
818
|
|
|
* Tests the setDisplayAmount method |
819
|
|
|
* |
820
|
|
|
* @return void |
821
|
|
|
* @covers ::setDisplayAmount |
822
|
|
|
* @covers ::getDisplayAmount |
823
|
|
|
* @covers ::isBool |
824
|
|
|
*/ |
825
|
|
|
public function testSetDisplayAmount() |
826
|
|
|
{ |
827
|
|
|
// Test the default value |
828
|
|
|
$this->assertTrue($this->paymentSlip->getDisplayAmount()); |
829
|
|
|
|
830
|
|
|
// Disable feature, also check for returned instance |
831
|
|
|
$returned = $this->paymentSlip->setDisplayAmount(false); |
832
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
833
|
|
|
$this->assertFalse($this->paymentSlip->getDisplayAmount()); |
834
|
|
|
|
835
|
|
|
// Re-enable the feature |
836
|
|
|
$this->paymentSlip->setDisplayAmount(); |
837
|
|
|
$this->assertTrue($this->paymentSlip->getDisplayAmount()); |
838
|
|
|
|
839
|
|
|
// Check if the data is disabled |
840
|
|
|
$this->paymentSlip->getPaymentSlipData()->setWithAmount(false); |
841
|
|
|
$this->assertFalse($this->paymentSlip->getDisplayAmount()); |
842
|
|
|
} |
843
|
|
|
|
844
|
|
|
/** |
845
|
|
|
* Tests the setDisplayAmount method with an invalid parameter |
846
|
|
|
* |
847
|
|
|
* @return void |
848
|
|
|
* @expectedException \InvalidArgumentException |
849
|
|
|
* @expectedExceptionMessage $displayAmount is not a boolean. |
850
|
|
|
* @covers ::setDisplayAmount |
851
|
|
|
* @covers ::isBool |
852
|
|
|
*/ |
853
|
|
|
public function testSetDisplayAmountInvalidParameter() |
854
|
|
|
{ |
855
|
|
|
$this->paymentSlip->setDisplayAmount('true'); |
|
|
|
|
856
|
|
|
} |
857
|
|
|
|
858
|
|
|
/** |
859
|
|
|
* Tests the setDisplayPayer method |
860
|
|
|
* |
861
|
|
|
* @return void |
862
|
|
|
* @covers ::setDisplayPayer |
863
|
|
|
* @covers ::getDisplayPayer |
864
|
|
|
* @covers ::isBool |
865
|
|
|
*/ |
866
|
|
|
public function testSetDisplayPayer() |
867
|
|
|
{ |
868
|
|
|
// Test the default value |
869
|
|
|
$this->assertTrue($this->paymentSlip->getDisplayPayer()); |
870
|
|
|
|
871
|
|
|
// Disable feature, also check for returned instance |
872
|
|
|
$returned = $this->paymentSlip->setDisplayPayer(false); |
873
|
|
|
$this->assertInstanceOf('SwissPaymentSlip\SwissPaymentSlip\Tests\TestablePaymentSlip', $returned); |
874
|
|
|
$this->assertFalse($this->paymentSlip->getDisplayPayer()); |
875
|
|
|
|
876
|
|
|
// Re-enable the feature |
877
|
|
|
$this->paymentSlip->setDisplayPayer(); |
878
|
|
|
$this->assertTrue($this->paymentSlip->getDisplayPayer()); |
879
|
|
|
|
880
|
|
|
// Check if the data is disabled |
881
|
|
|
$this->paymentSlip->getPaymentSlipData()->setWithPayer(false); |
882
|
|
|
$this->assertFalse($this->paymentSlip->getDisplayPayer()); |
883
|
|
|
} |
884
|
|
|
|
885
|
|
|
/** |
886
|
|
|
* Tests the setDisplayPayer method with an invalid parameter |
887
|
|
|
* |
888
|
|
|
* @return void |
889
|
|
|
* @expectedException \InvalidArgumentException |
890
|
|
|
* @expectedExceptionMessage $displayPayer is not a boolean. |
891
|
|
|
* @covers ::setDisplayPayer |
892
|
|
|
* @covers ::isBool |
893
|
|
|
*/ |
894
|
|
|
public function testSetDisplayPayerInvalidParameter() |
895
|
|
|
{ |
896
|
|
|
$this->paymentSlip->setDisplayPayer('true'); |
|
|
|
|
897
|
|
|
} |
898
|
|
|
|
899
|
|
|
/** |
900
|
|
|
* Tests the getAllElements method |
901
|
|
|
* |
902
|
|
|
* @return void |
903
|
|
|
* @covers ::getAllElements |
904
|
|
|
*/ |
905
|
|
|
public function testGetAllElements() |
906
|
|
|
{ |
907
|
|
|
$elements = $this->paymentSlip->getAllElements(); |
908
|
|
|
|
909
|
|
|
$expectedElements = array( |
910
|
|
|
'bankLeft', |
911
|
|
|
'bankRight', |
912
|
|
|
'recipientLeft', |
913
|
|
|
'recipientRight', |
914
|
|
|
'accountLeft', |
915
|
|
|
'accountRight', |
916
|
|
|
'amountFrancsLeft', |
917
|
|
|
'amountFrancsRight', |
918
|
|
|
'amountCentsLeft', |
919
|
|
|
'amountCentsRight', |
920
|
|
|
'payerLeft', |
921
|
|
|
'payerRight' |
922
|
|
|
); |
923
|
|
|
|
924
|
|
|
$this->assertElementsArray($expectedElements, $elements); |
925
|
|
|
} |
926
|
|
|
|
927
|
|
|
/** |
928
|
|
|
* Tests the getAllElements method when no elements are shown |
929
|
|
|
* |
930
|
|
|
* @return void |
931
|
|
|
* @covers ::getAllElements |
932
|
|
|
*/ |
933
|
|
|
public function testGetAllElementsNoElementsShown() |
934
|
|
|
{ |
935
|
|
|
$this->paymentSlip->setDisplayAccount(false); |
936
|
|
|
$this->paymentSlip->setDisplayAmount(false); |
937
|
|
|
$this->paymentSlip->setDisplayBank(false); |
938
|
|
|
$this->paymentSlip->setDisplayPayer(false); |
939
|
|
|
$this->paymentSlip->setDisplayRecipient(false); |
940
|
|
|
|
941
|
|
|
$elements = $this->paymentSlip->getAllElements(); |
942
|
|
|
|
943
|
|
|
$expectedElements = array(); |
944
|
|
|
|
945
|
|
|
$this->assertElementsArray($expectedElements, $elements); |
946
|
|
|
} |
947
|
|
|
|
948
|
|
|
/** |
949
|
|
|
* Tests the getAllElements method when all data is disabled |
950
|
|
|
* |
951
|
|
|
* @return void |
952
|
|
|
* @covers ::getAllElements |
953
|
|
|
*/ |
954
|
|
|
public function testGetAllElementsDisabledData() |
955
|
|
|
{ |
956
|
|
|
$paymentSlipData = $this->paymentSlip->getPaymentSlipData(); |
957
|
|
|
$paymentSlipData->setWithAccountNumber(false); |
958
|
|
|
$paymentSlipData->setWithAmount(false); |
959
|
|
|
$paymentSlipData->setWithBank(false); |
960
|
|
|
$paymentSlipData->setWithPayer(false); |
961
|
|
|
$paymentSlipData->setWithRecipient(false); |
962
|
|
|
|
963
|
|
|
$elements = $this->paymentSlip->getAllElements(); |
964
|
|
|
|
965
|
|
|
$expectedElements = array(); |
966
|
|
|
|
967
|
|
|
$this->assertElementsArray($expectedElements, $elements); |
968
|
|
|
} |
969
|
|
|
} |
970
|
|
|
|