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

ElicitSlotDirectiveTest::testCreateWithIntent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 7
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;
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