Completed
Pull Request — master (#204)
by Ryan
11:34
created

Issue99Test   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 3
dl 0
loc 20
rs 10
1
<?php
2
/**
3
 * Copyright (c) 2015–2018 Alexandr Viniychuk <http://youshido.com>.
4
 * Copyright (c) 2015–2018 Portey Vasil <https://github.com/portey>.
5
 * Copyright (c) 2018 Ryan Parman <https://github.com/skyzyx>.
6
 * Copyright (c) 2018 Ashley Hutson <https://github.com/asheliahut>.
7
 * Copyright (c) 2015–2018 Contributors.
8
 *
9
 * http://opensource.org/licenses/MIT
10
 */
11
12
declare(strict_types=1);
13
14
namespace Youshido\Tests\Issues\Issue99;
15
16
use Youshido\GraphQL\Execution\Processor;
17
18
/**
19
 * User: m-naw
20
 * Date: 2/02/17.
21
 */
22
class Issue99Test extends \PHPUnit_Framework_TestCase
23
{
24
    public const BUG_NOT_EXISTS_VALUE = 'bug not exists';
25
26
    public const BUG_EXISTS_VALUE = 'bug exists';
27
28
    public function testQueryDateTimeTypeWithDateParameter(): void
29
    {
30
        $schema    = new Issue99Schema();
31
        $processor = new Processor($schema);
32
        $processor->processPayload(\sprintf('{ items{id, custom(argX: {x: "%s"}){ value } } }', self::BUG_NOT_EXISTS_VALUE));
33
        $res = $processor->getResponseData();
34
35
        self::assertTrue(isset($res['data']['items']));
36
37
        foreach ($res['data']['items'] as $item) {
38
            self::assertTrue(isset($item['custom']['value']));
39
            self::assertEquals(self::BUG_NOT_EXISTS_VALUE, $item['custom']['value']);
40
        }
41
    }
42
}
43