| 1 | <?php |
||
| 9 | class StructureTest extends TestCase |
||
| 10 | { |
||
| 11 | public function testStructure() |
||
| 12 | { |
||
| 13 | $structure = new Structure(); |
||
| 14 | |||
| 15 | $structure->addHeaderField(new Field('balance', '13.50 USD')); |
||
| 16 | $structure->addBackField(new Field('publisher', 'Passbook Limited')); |
||
| 17 | |||
| 18 | $actual = $structure->toArray(); |
||
| 19 | $expected = [ |
||
| 20 | "headerFields" => [ |
||
| 21 | ["key" => "balance", "value" => "13.50 USD"], |
||
| 22 | ], |
||
| 23 | "backFields" => [ |
||
| 24 | ["key" => "publisher", "value" => "Passbook Limited"] |
||
| 25 | ] |
||
| 26 | ]; |
||
| 27 | |||
| 28 | $this->assertEquals($expected, $actual); |
||
| 29 | } |
||
| 30 | } |