StructureTest::testStructure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 1
eloc 10
c 2
b 0
f 1
nc 1
nop 0
dl 0
loc 18
rs 9.9332
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
}
31