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

TypeTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 8
c 1
b 0
f 0
dl 0
loc 14
rs 10

1 Method

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