1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0 |
5
|
|
|
* @copyright Metaways Infosystems GmbH, 2011 |
6
|
|
|
* @copyright Aimeos (aimeos.org), 2015-2018 |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace Aimeos\MShop\Price\Item; |
10
|
|
|
|
11
|
|
|
|
12
|
|
|
class StandardTest extends \PHPUnit\Framework\TestCase |
13
|
|
|
{ |
14
|
|
|
private $object; |
15
|
|
|
private $values; |
16
|
|
|
|
17
|
|
|
|
18
|
|
|
protected function setUp() |
19
|
|
|
{ |
20
|
|
|
$this->values = array( |
21
|
|
|
'price.id' => 199, |
22
|
|
|
'price.siteid' => 99, |
23
|
|
|
'price.type' => 'default', |
24
|
|
|
'price.currencyid' => 'EUR', |
25
|
|
|
'price.domain' => 'product', |
26
|
|
|
'price.label' => 'Price label', |
27
|
|
|
'price.quantity' => 15, |
28
|
|
|
'price.value' => '195.50', |
29
|
|
|
'price.costs' => '19.95', |
30
|
|
|
'price.rebate' => '10.00', |
31
|
|
|
'price.tax' => '34.3995', |
32
|
|
|
'price.taxrates' => ['' => '19.00', 'local' => '5.00'], |
33
|
|
|
'price.taxflag' => true, |
34
|
|
|
'price.status' => true, |
35
|
|
|
'price.mtime' => '2011-01-01 00:00:02', |
36
|
|
|
'price.ctime' => '2011-01-01 00:00:01', |
37
|
|
|
'price.editor' => 'unitTestUser', |
38
|
|
|
'currencyid' => 'EUR', |
39
|
|
|
); |
40
|
|
|
|
41
|
|
|
$this->object = new \Aimeos\MShop\Price\Item\Standard( $this->values ); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
|
45
|
|
|
protected function tearDown() |
46
|
|
|
{ |
47
|
|
|
unset( $this->object ); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
|
51
|
|
|
public function testAddItem() |
52
|
|
|
{ |
53
|
|
|
$price = new \Aimeos\MShop\Price\Item\Standard( $this->values ); |
54
|
|
|
$return = $this->object->addItem( $price ); |
55
|
|
|
|
56
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
57
|
|
|
$this->assertEquals( '391.00', $this->object->getValue() ); |
58
|
|
|
$this->assertEquals( '39.90', $this->object->getCosts() ); |
59
|
|
|
$this->assertEquals( '20.00', $this->object->getRebate() ); |
60
|
|
|
$this->assertEquals( '68.7990', $this->object->getTaxValue() ); |
61
|
|
|
$this->assertEquals( 1, $this->object->getQuantity() ); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
|
65
|
|
|
public function testAddItemSelf() |
66
|
|
|
{ |
67
|
|
|
$return = $this->object->addItem( $this->object ); |
68
|
|
|
|
69
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
70
|
|
|
$this->assertEquals( '391.00', $this->object->getValue() ); |
71
|
|
|
$this->assertEquals( '39.90', $this->object->getCosts() ); |
72
|
|
|
$this->assertEquals( '20.00', $this->object->getRebate() ); |
73
|
|
|
$this->assertEquals( '68.7990', $this->object->getTaxValue() ); |
74
|
|
|
$this->assertEquals( 1, $this->object->getQuantity() ); |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
|
78
|
|
|
public function testAddItemWrongCurrency() |
79
|
|
|
{ |
80
|
|
|
$values = $this->values; |
81
|
|
|
$values['price.currencyid'] = 'USD'; |
82
|
|
|
|
83
|
|
|
$price = new \Aimeos\MShop\Price\Item\Standard( $values ); |
84
|
|
|
|
85
|
|
|
$this->setExpectedException( \Aimeos\MShop\Price\Exception::class ); |
86
|
|
|
$this->object->addItem( $price ); |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
|
90
|
|
|
public function testClear() |
91
|
|
|
{ |
92
|
|
|
$result = $this->object->clear(); |
93
|
|
|
|
94
|
|
|
$this->assertInstanceOf( 'Aimeos\MShop\Price\Item\Iface', $result ); |
95
|
|
|
$this->assertEquals( '0.00', $this->object->getValue() ); |
96
|
|
|
$this->assertEquals( '0.00', $this->object->getCosts() ); |
97
|
|
|
$this->assertEquals( '0.00', $this->object->getRebate() ); |
98
|
|
|
$this->assertEquals( '0.00', $this->object->getTaxValue() ); |
99
|
|
|
$this->assertEquals( true, $this->object->getTaxFlag() ); |
100
|
|
|
$this->assertEquals( 1, $this->object->getQuantity() ); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
|
104
|
|
|
public function testCompare() |
105
|
|
|
{ |
106
|
|
|
$price = new \Aimeos\MShop\Price\Item\Standard( $this->values ); |
107
|
|
|
$this->assertTrue( $this->object->compare( $price ) ); |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
|
111
|
|
|
public function testCompareFail() |
112
|
|
|
{ |
113
|
|
|
$values = $this->values; |
114
|
|
|
$values['price.value'] = '200.00'; |
115
|
|
|
|
116
|
|
|
$price = new \Aimeos\MShop\Price\Item\Standard( $values ); |
117
|
|
|
$this->assertFalse( $this->object->compare( $price ) ); |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
|
121
|
|
|
public function testGetPrecision() |
122
|
|
|
{ |
123
|
|
|
$this->assertEquals( 2, $this->object->getPrecision() ); |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
|
127
|
|
|
public function testGetId() |
128
|
|
|
{ |
129
|
|
|
$this->assertEquals( 199, $this->object->getId() ); |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
|
133
|
|
|
public function testSetId() |
134
|
|
|
{ |
135
|
|
|
$return = $this->object->setId( null ); |
136
|
|
|
|
137
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
138
|
|
|
$this->assertNull( $this->object->getId() ); |
139
|
|
|
$this->assertTrue( $this->object->isModified() ); |
140
|
|
|
} |
141
|
|
|
|
142
|
|
|
|
143
|
|
|
public function testGetSiteId() |
144
|
|
|
{ |
145
|
|
|
$this->assertEquals( 99, $this->object->getSiteId() ); |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
|
149
|
|
|
public function testGetType() |
150
|
|
|
{ |
151
|
|
|
$this->assertEquals( 'default', $this->object->getType() ); |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
|
155
|
|
|
public function testSetType() |
156
|
|
|
{ |
157
|
|
|
$this->object->setType( 'test' ); |
158
|
|
|
$this->assertEquals( 'test', $this->object->getType() ); |
159
|
|
|
|
160
|
|
|
$this->assertTrue( $this->object->isModified() ); |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
|
164
|
|
|
public function testGetCurrencyId() |
165
|
|
|
{ |
166
|
|
|
$this->assertEquals( 'EUR', $this->object->getCurrencyId() ); |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
|
170
|
|
|
public function testSetCurrencyId() |
171
|
|
|
{ |
172
|
|
|
$return = $this->object->setCurrencyId( 'USD' ); |
173
|
|
|
|
174
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
175
|
|
|
$this->assertEquals( 'USD', $this->object->getCurrencyId() ); |
176
|
|
|
$this->assertTrue( $this->object->isModified() ); |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
|
180
|
|
|
public function testSetCurrencyIdNull() |
181
|
|
|
{ |
182
|
|
|
$this->setExpectedException( \Aimeos\MShop\Exception::class ); |
183
|
|
|
$this->object->setCurrencyId( null ); |
184
|
|
|
} |
185
|
|
|
|
186
|
|
|
|
187
|
|
|
public function testSetCurrencyIdInvalid() |
188
|
|
|
{ |
189
|
|
|
$this->setExpectedException( \Aimeos\MShop\Exception::class ); |
190
|
|
|
$this->object->setCurrencyId( 'usd' ); |
191
|
|
|
} |
192
|
|
|
|
193
|
|
|
|
194
|
|
|
public function testGetDomain() |
195
|
|
|
{ |
196
|
|
|
$this->assertEquals( 'product', $this->object->getDomain() ); |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
|
200
|
|
|
public function testSetDomain() |
201
|
|
|
{ |
202
|
|
|
$return = $this->object->setDomain( 'service' ); |
203
|
|
|
|
204
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
205
|
|
|
$this->assertEquals( 'service', $this->object->getDomain() ); |
206
|
|
|
$this->assertTrue( $this->object->isModified() ); |
207
|
|
|
} |
208
|
|
|
|
209
|
|
|
|
210
|
|
|
public function testGetLabel() |
211
|
|
|
{ |
212
|
|
|
$this->assertEquals( 'Price label', $this->object->getLabel() ); |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
|
216
|
|
|
public function testSetLabel() |
217
|
|
|
{ |
218
|
|
|
$return = $this->object->setLabel( 'special price' ); |
219
|
|
|
|
220
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
221
|
|
|
$this->assertEquals( 'special price', $this->object->getlabel() ); |
222
|
|
|
$this->assertTrue( $this->object->isModified() ); |
223
|
|
|
} |
224
|
|
|
|
225
|
|
|
|
226
|
|
|
public function testGetQuantity() |
227
|
|
|
{ |
228
|
|
|
$this->assertEquals( 15, $this->object->getQuantity() ); |
229
|
|
|
} |
230
|
|
|
|
231
|
|
|
|
232
|
|
|
public function testSetQuantity() |
233
|
|
|
{ |
234
|
|
|
$return = $this->object->setQuantity( 20 ); |
235
|
|
|
|
236
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
237
|
|
|
$this->assertEquals( 20, $this->object->getQuantity() ); |
238
|
|
|
$this->assertTrue( $this->object->isModified() ); |
239
|
|
|
} |
240
|
|
|
|
241
|
|
|
|
242
|
|
|
public function testGetPrice() |
243
|
|
|
{ |
244
|
|
|
$this->assertEquals( '195.50', $this->object->getValue() ); |
245
|
|
|
} |
246
|
|
|
|
247
|
|
|
|
248
|
|
|
public function testSetPrice() |
249
|
|
|
{ |
250
|
|
|
$return = $this->object->setValue( 199.00 ); |
251
|
|
|
|
252
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
253
|
|
|
$this->assertEquals( 199.00, $this->object->getValue() ); |
254
|
|
|
$this->assertTrue( $this->object->isModified() ); |
255
|
|
|
|
256
|
|
|
$this->setExpectedException( \Aimeos\MShop\Price\Exception::class ); |
257
|
|
|
$this->object->setValue( '190,90' ); |
258
|
|
|
} |
259
|
|
|
|
260
|
|
|
|
261
|
|
|
public function testGetCosts() |
262
|
|
|
{ |
263
|
|
|
$this->assertEquals( '19.95', $this->object->getCosts() ); |
264
|
|
|
} |
265
|
|
|
|
266
|
|
|
|
267
|
|
|
public function testSetCosts() |
268
|
|
|
{ |
269
|
|
|
$return = $this->object->setValue( '20.00' ); |
270
|
|
|
|
271
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
272
|
|
|
$this->assertEquals( 20.00, $this->object->getValue() ); |
273
|
|
|
$this->assertTrue( $this->object->isModified() ); |
274
|
|
|
|
275
|
|
|
$this->setExpectedException( \Aimeos\MShop\Price\Exception::class ); |
276
|
|
|
$this->object->setValue( '19,90' ); |
277
|
|
|
} |
278
|
|
|
|
279
|
|
|
|
280
|
|
|
public function testGetRebate() |
281
|
|
|
{ |
282
|
|
|
$this->assertEquals( '10.00', $this->object->getRebate() ); |
283
|
|
|
} |
284
|
|
|
|
285
|
|
|
|
286
|
|
|
public function testSetRebate() |
287
|
|
|
{ |
288
|
|
|
$return = $this->object->setRebate( '20.00' ); |
289
|
|
|
|
290
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
291
|
|
|
$this->assertEquals( 20.00, $this->object->getRebate() ); |
292
|
|
|
$this->assertTrue( $this->object->isModified() ); |
293
|
|
|
|
294
|
|
|
$this->setExpectedException( \Aimeos\MShop\Price\Exception::class ); |
295
|
|
|
$this->object->setValue( '19,90' ); |
296
|
|
|
} |
297
|
|
|
|
298
|
|
|
|
299
|
|
|
public function testGetTaxRate() |
300
|
|
|
{ |
301
|
|
|
$this->assertEquals( '19.00', $this->object->getTaxRate() ); |
302
|
|
|
} |
303
|
|
|
|
304
|
|
|
|
305
|
|
|
public function testGetTaxRates() |
306
|
|
|
{ |
307
|
|
|
$this->assertEquals( ['' => '19.00', 'local' => '5.0'], $this->object->getTaxRates() ); |
308
|
|
|
} |
309
|
|
|
|
310
|
|
|
|
311
|
|
|
public function testSetTaxRate() |
312
|
|
|
{ |
313
|
|
|
$return = $this->object->setTaxRate( '22.00' ); |
314
|
|
|
|
315
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
316
|
|
|
$this->assertEquals( '22.00', $this->object->getTaxRate() ); |
317
|
|
|
$this->assertTrue( $this->object->isModified() ); |
318
|
|
|
} |
319
|
|
|
|
320
|
|
|
|
321
|
|
|
public function testSetTaxRates() |
322
|
|
|
{ |
323
|
|
|
$value = ['' => '22.00', 'local' => '10.00']; |
324
|
|
|
$return = $this->object->setTaxRates( $value ); |
325
|
|
|
|
326
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
327
|
|
|
$this->assertEquals( ['' => '22.00', 'local' => '10.00'], $this->object->getTaxRates() ); |
328
|
|
|
$this->assertTrue( $this->object->isModified() ); |
329
|
|
|
} |
330
|
|
|
|
331
|
|
|
|
332
|
|
|
public function testGetTaxFlag() |
333
|
|
|
{ |
334
|
|
|
$this->assertEquals( true, $this->object->getTaxFlag() ); |
335
|
|
|
} |
336
|
|
|
|
337
|
|
|
|
338
|
|
|
public function testSetTaxFlag() |
339
|
|
|
{ |
340
|
|
|
$return = $this->object->setTaxFlag( false ); |
341
|
|
|
|
342
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
343
|
|
|
$this->assertEquals( false, $this->object->getTaxFlag() ); |
344
|
|
|
$this->assertTrue( $this->object->isModified() ); |
345
|
|
|
} |
346
|
|
|
|
347
|
|
|
|
348
|
|
|
public function testGetTaxValue() |
349
|
|
|
{ |
350
|
|
|
$this->assertEquals( '34.3995', $this->object->getTaxValue() ); |
351
|
|
|
} |
352
|
|
|
|
353
|
|
|
|
354
|
|
|
public function testGetTaxValueFromNetprice() |
355
|
|
|
{ |
356
|
|
|
$values = array( |
357
|
|
|
'price.quantity' => 10, |
358
|
|
|
'price.value' => 195.50, |
359
|
|
|
'price.costs' => 19.95, |
360
|
|
|
'price.taxrates' => ['' => '19.00', 'local' => '5.00'], |
361
|
|
|
'price.taxflag' => false, |
362
|
|
|
); |
363
|
|
|
|
364
|
|
|
$object = new \Aimeos\MShop\Price\Item\Standard( $values ); |
365
|
|
|
$this->assertEquals( '51.7080', $object->getTaxValue() ); |
366
|
|
|
|
367
|
|
|
|
368
|
|
|
$values['price.taxflag'] = true; |
369
|
|
|
|
370
|
|
|
$object = new \Aimeos\MShop\Price\Item\Standard( $values ); |
371
|
|
|
$this->assertEquals( '41.7000', $object->getTaxValue() ); |
372
|
|
|
} |
373
|
|
|
|
374
|
|
|
|
375
|
|
|
public function testSetTaxValue() |
376
|
|
|
{ |
377
|
|
|
$return = $this->object->setTaxValue( '100.00' ); |
378
|
|
|
|
379
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
380
|
|
|
$this->assertEquals( '100.00', $this->object->getTaxValue() ); |
381
|
|
|
$this->assertTrue( $this->object->isModified() ); |
382
|
|
|
} |
383
|
|
|
|
384
|
|
|
|
385
|
|
|
public function testGetStatus() |
386
|
|
|
{ |
387
|
|
|
$this->assertEquals( 1, $this->object->getStatus() ); |
388
|
|
|
} |
389
|
|
|
|
390
|
|
|
|
391
|
|
|
public function testSetStatus() |
392
|
|
|
{ |
393
|
|
|
$return = $this->object->setStatus( 0 ); |
394
|
|
|
|
395
|
|
|
$this->assertInstanceOf( \Aimeos\MShop\Price\Item\Iface::class, $return ); |
396
|
|
|
$this->assertEquals( 0, $this->object->getStatus() ); |
397
|
|
|
$this->assertTrue( $this->object->isModified() ); |
398
|
|
|
} |
399
|
|
|
|
400
|
|
|
|
401
|
|
|
public function testGetTimeModified() |
402
|
|
|
{ |
403
|
|
|
$this->assertEquals( '2011-01-01 00:00:02', $this->object->getTimeModified() ); |
404
|
|
|
} |
405
|
|
|
|
406
|
|
|
|
407
|
|
|
public function testGetTimeCreated() |
408
|
|
|
{ |
409
|
|
|
$this->assertEquals( '2011-01-01 00:00:01', $this->object->getTimeCreated() ); |
410
|
|
|
} |
411
|
|
|
|
412
|
|
|
|
413
|
|
|
public function testGetEditor() |
414
|
|
|
{ |
415
|
|
|
$this->assertEquals( 'unitTestUser', $this->object->getEditor() ); |
416
|
|
|
} |
417
|
|
|
|
418
|
|
|
|
419
|
|
|
public function testGetResourceType() |
420
|
|
|
{ |
421
|
|
|
$this->assertEquals( 'price', $this->object->getResourceType() ); |
422
|
|
|
} |
423
|
|
|
|
424
|
|
|
|
425
|
|
|
public function testFromArray() |
426
|
|
|
{ |
427
|
|
|
$item = new \Aimeos\MShop\Price\Item\Standard(); |
428
|
|
|
|
429
|
|
|
$list = $entries = array( |
430
|
|
|
'price.id' => 1, |
431
|
|
|
'price.type' => 'test', |
432
|
|
|
'price.label' => 'test item', |
433
|
|
|
'price.currencyid' => 'EUR', |
434
|
|
|
'price.quantity' => 3, |
435
|
|
|
'price.value' => '10.00', |
436
|
|
|
'price.costs' => '5.00', |
437
|
|
|
'price.rebate' => '2.00', |
438
|
|
|
'price.taxvalue' => '3.00', |
439
|
|
|
'price.taxrates' => ['' => '20.00'], |
440
|
|
|
'price.taxrate' => '20.00', |
441
|
|
|
'price.taxflag' => false, |
442
|
|
|
'price.status' => 0, |
443
|
|
|
); |
444
|
|
|
|
445
|
|
|
$item = $item->fromArray( $entries, true ); |
446
|
|
|
|
447
|
|
|
$this->assertEquals( [], $entries ); |
448
|
|
|
$this->assertEquals( $list['price.id'], $item->getId() ); |
449
|
|
|
$this->assertEquals( $list['price.type'], $item->getType() ); |
450
|
|
|
$this->assertEquals( $list['price.label'], $item->getLabel() ); |
451
|
|
|
$this->assertEquals( $list['price.currencyid'], $item->getCurrencyId() ); |
452
|
|
|
$this->assertEquals( $list['price.quantity'], $item->getQuantity() ); |
453
|
|
|
$this->assertEquals( $list['price.value'], $item->getValue() ); |
454
|
|
|
$this->assertEquals( $list['price.costs'], $item->getCosts() ); |
455
|
|
|
$this->assertEquals( $list['price.rebate'], $item->getRebate() ); |
456
|
|
|
$this->assertEquals( $list['price.taxvalue'], $item->getTaxValue() ); |
457
|
|
|
$this->assertEquals( $list['price.taxrates'], $item->getTaxRates() ); |
458
|
|
|
$this->assertEquals( $list['price.taxrate'], $item->getTaxRate() ); |
459
|
|
|
$this->assertEquals( $list['price.taxflag'], $item->getTaxFlag() ); |
460
|
|
|
$this->assertEquals( $list['price.status'], $item->getStatus() ); |
461
|
|
|
$this->assertNull( $item->getSiteId() ); |
462
|
|
|
} |
463
|
|
|
|
464
|
|
|
|
465
|
|
|
public function testToArray() |
466
|
|
|
{ |
467
|
|
|
$arrayObject = $this->object->toArray( true ); |
468
|
|
|
|
469
|
|
|
$this->assertEquals( count( $this->values ), count( $arrayObject ) ); |
470
|
|
|
|
471
|
|
|
$this->assertEquals( $this->object->getId(), $arrayObject['price.id'] ); |
472
|
|
|
$this->assertEquals( $this->object->getType(), $arrayObject['price.type'] ); |
473
|
|
|
$this->assertEquals( $this->object->getSiteId(), $arrayObject['price.siteid'] ); |
474
|
|
|
$this->assertEquals( $this->object->getLabel(), $arrayObject['price.label'] ); |
475
|
|
|
$this->assertEquals( $this->object->getDomain(), $arrayObject['price.domain'] ); |
476
|
|
|
$this->assertEquals( $this->object->getCurrencyId(), $arrayObject['price.currencyid'] ); |
477
|
|
|
$this->assertEquals( $this->object->getQuantity(), $arrayObject['price.quantity'] ); |
478
|
|
|
$this->assertEquals( $this->object->getValue(), $arrayObject['price.value'] ); |
479
|
|
|
$this->assertEquals( $this->object->getCosts(), $arrayObject['price.costs'] ); |
480
|
|
|
$this->assertEquals( $this->object->getRebate(), $arrayObject['price.rebate'] ); |
481
|
|
|
$this->assertEquals( $this->object->getTaxValue(), $arrayObject['price.taxvalue'] ); |
482
|
|
|
$this->assertEquals( $this->object->getTaxRates(), $arrayObject['price.taxrates'] ); |
483
|
|
|
$this->assertEquals( $this->object->getTaxRate(), $arrayObject['price.taxrate'] ); |
484
|
|
|
$this->assertEquals( $this->object->getTaxFlag(), $arrayObject['price.taxflag'] ); |
485
|
|
|
$this->assertEquals( $this->object->getStatus(), $arrayObject['price.status'] ); |
486
|
|
|
$this->assertEquals( $this->object->getTimeCreated(), $arrayObject['price.ctime'] ); |
487
|
|
|
$this->assertEquals( $this->object->getTimeModified(), $arrayObject['price.mtime'] ); |
488
|
|
|
$this->assertEquals( $this->object->getEditor(), $arrayObject['price.editor'] ); |
489
|
|
|
} |
490
|
|
|
|
491
|
|
|
|
492
|
|
|
public function testIsAvailable() |
493
|
|
|
{ |
494
|
|
|
$this->assertTrue( $this->object->isAvailable() ); |
495
|
|
|
$this->object->setAvailable( false ); |
496
|
|
|
$this->assertFalse( $this->object->isAvailable() ); |
497
|
|
|
} |
498
|
|
|
|
499
|
|
|
|
500
|
|
|
public function testIsAvailableOnStatus() |
501
|
|
|
{ |
502
|
|
|
$this->assertTrue( $this->object->isAvailable() ); |
503
|
|
|
$this->object->setStatus( 0 ); |
504
|
|
|
$this->assertFalse( $this->object->isAvailable() ); |
505
|
|
|
$this->object->setStatus( -1 ); |
506
|
|
|
$this->assertFalse( $this->object->isAvailable() ); |
507
|
|
|
} |
508
|
|
|
|
509
|
|
|
|
510
|
|
|
public function testIsModified() |
511
|
|
|
{ |
512
|
|
|
$this->assertFalse( $this->object->isModified() ); |
513
|
|
|
} |
514
|
|
|
} |
515
|
|
|
|