Passed
Push — master ( 4b2c1a...a53d55 )
by Maximilian
02:53
created

ElicitSlotDirectiveTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
c 0
b 0
f 0
dl 0
loc 15
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreateWithIntent() 0 7 1
A testCreate() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace MaxBeckers\AmazonAlexa\Test\Response\Directives\Dialog;
6
7
use MaxBeckers\AmazonAlexa\Intent\Intent;
8
use MaxBeckers\AmazonAlexa\Response\Directives\Dialog\ElicitSlotDirective;
9
use PHPUnit\Framework\TestCase;
10
11
class ElicitSlotDirectiveTest extends TestCase
12
{
13
    public function testCreate(): void
14
    {
15
        $elicitSlotDirective = ElicitSlotDirective::create('');
16
        $this->assertSame('Dialog.ElicitSlot', $elicitSlotDirective->type);
17
    }
18
19
    public function testCreateWithIntent(): void
20
    {
21
        $json = file_get_contents(__DIR__ . '/../../../Intent/Data/intent_without_resolutions.json');
22
        $intent = Intent::fromAmazonRequest(json_decode($json, true));
23
24
        $elicitSlotDirective = ElicitSlotDirective::create('', $intent);
25
        $this->assertSame('Dialog.ElicitSlot', $elicitSlotDirective->type);
26
    }
27
}
28