StructureTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 11
c 2
b 0
f 1
dl 0
loc 20
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testStructure() 0 18 1
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