Conditions | 1 |
Paths | 1 |
Total Lines | 25 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function testCustomElements() |
||
11 | { |
||
12 | $helper = new XMLWriterHelper(); |
||
13 | $offer = new Offer([ |
||
14 | 'id' => 1, |
||
15 | 'available' => true, |
||
16 | 'url' => 'http://example.com/item/1', |
||
17 | 'price' => 1560, |
||
18 | 'currencyId' => 'RUR', |
||
19 | 'categoryId' => 1, |
||
20 | 'picture' => 'http://example.com/images/1.jpg', |
||
21 | 'name' => 'Jacket', |
||
22 | 'vendor' => 'Manufacturer', |
||
23 | 'description' => 'Item description', |
||
24 | 'customElements' => [ |
||
25 | [ |
||
26 | 'outlets' => '<outlet id="1" instock="30" />' |
||
27 | ] |
||
28 | ], |
||
29 | ]); |
||
30 | |||
31 | $expected = '<offer id="1" available="1"><outlets><outlet id="1" instock="30" /></outlets><url>http://example.com/item/1</url><price>1560</price><currencyId>RUR</currencyId><categoryId>1</categoryId><picture>http://example.com/images/1.jpg</picture><name>Jacket</name><vendor>Manufacturer</vendor><description>Item description</description></offer>'; |
||
32 | |||
33 | $this->assertEquals($expected, $helper->renderOffer($offer)); |
||
34 | } |
||
35 | } |
||
36 |