Passed
Branch develop (84afed)
by Paulius
02:35
created

DeleteTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
namespace Dokobit\Gateway\Tests\Query\File;
3
4
use Dokobit\Gateway\Query\File\Delete;
5
use Dokobit\Gateway\Query\QueryInterface;
6
use Dokobit\Gateway\Tests\TestCase;
7
8
class DeleteTest extends TestCase
9
{
10
    const TOKEN = 'UploadedFileToken';
11
12
    /** @var Delete */
13
    private $query;
14
15
    protected function setUp(): void
16
    {
17
        $this->query = new Delete(
18
            self::TOKEN
19
        );
20
    }
21
22
    public function testGetFieldsPath()
23
    {
24
        $fields = $this->query->getFields();
25
26
        $this->assertArrayHasKey('token', $fields);
27
28
        $this->assertSame(self::TOKEN, $fields['token']);
29
    }
30
31
    public function testGetAction()
32
    {
33
        $this->assertSame('file/'.self::TOKEN.'/delete', $this->query->getAction());
34
    }
35
36
    public function testGetMethod()
37
    {
38
        $this->assertSame(QueryInterface::POST, $this->query->getMethod());
39
    }
40
41
    public function testCreateResult()
42
    {
43
        $this->assertInstanceOf('Dokobit\Gateway\Result\File\DeleteResult', $this->query->createResult());
44
    }
45
46
    public function testHasValidationConstraints()
47
    {
48
        $collection = $this->query->getValidationConstraints();
49
50
        $this->assertInstanceOf(
51
            'Symfony\Component\Validator\Constraints\Collection',
52
            $collection
53
        );
54
    }
55
}
56