Test Failed
Pull Request — master (#96)
by Maximilian
17:24
created

TypeTest::testCreate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 12
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MaxBeckers\AmazonAlexa\Test\Response\Directives\Dialog\Entity;
6
7
use MaxBeckers\AmazonAlexa\Response\Directives\Dialog\Entity\Type;
8
use MaxBeckers\AmazonAlexa\Response\Directives\Dialog\Entity\TypeValue;
9
use PHPUnit\Framework\TestCase;
10
11
class TypeTest extends TestCase
12
{
13
    public function testCreate(): void
14
    {
15
        $type = Type::create('AirportSlotType', [
16
            TypeValue::create('BOS', 'Logan International Airport', ['Boston Logan']),
17
            TypeValue::create('LGA', 'LaGuardia Airport', ['New York']),
18
        ]);
19
20
        $json = \file_get_contents(__DIR__ . '/../../../../Response/Data/directive_entity_type.json');
21
        $expected = \json_encode(\json_decode($json));
22
        $actual = \json_encode($type);
23
24
        $this->assertSame($expected, $actual);
25
    }
26
}
27