Completed
Push — master ( 3d21e8...29ef50 )
by Alexandr
9s
created

testQueryDateTimeTypeWithDateParameter()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 14
rs 9.4285
cc 2
eloc 9
nc 2
nop 0
1
<?php
2
3
namespace Youshido\Tests\Issues\Issue99;
4
5
use Youshido\GraphQL\Execution\Processor;
6
7
/**
8
 * User: m-naw
9
 * Date: 2/02/17
10
 */
11
class Issue99Test extends \PHPUnit_Framework_TestCase
12
{
13
    const BUG_NOT_EXISTS_VALUE = 'bug not exists';
14
    const BUG_EXISTS_VALUE = 'bug exists';
15
16
    public function testQueryDateTimeTypeWithDateParameter()
17
    {
18
        $schema = new Issue99Schema();
19
        $processor = new Processor($schema);
20
        $processor->processPayload(sprintf("{ items{id, custom(argX: {x: \"%s\"}){ value } } }", self::BUG_NOT_EXISTS_VALUE));
21
        $res = $processor->getResponseData();
22
23
        self::assertTrue(isset($res['data']['items']));
24
25
        foreach($res['data']['items'] as $item) {
26
            self::assertTrue(isset($item['custom']['value']));
27
            self::assertEquals(self::BUG_NOT_EXISTS_VALUE, $item['custom']['value']);
28
        }
29
    }
30
}