Passed
Push — maintenance-work ( b6a05d...a58b3b )
by Razvan
12:47
created

StructureTest::testStructure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 10
nc 1
nop 0
dl 0
loc 18
rs 9.9332
c 0
b 0
f 0
1
<?php
2
3
namespace Passbook\Tests\Pass;
4
5
use Passbook\Pass\Structure;
6
use Passbook\Pass\Field;
7
use PHPUnit\Framework\TestCase;
8
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
}