Completed
Push — master ( 631929...5231d5 )
by Alexandr
02:39
created

Issue109Test::testInternalVariableArgument()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 8.9713
c 0
b 0
f 0
cc 1
eloc 12
nc 1
nop 0
1
<?php
2
3
namespace Youshido\Tests\Issues\Issue109;
4
5
use Youshido\GraphQL\Execution\Processor;
6
7
class Issue109Test extends \PHPUnit_Framework_TestCase
8
{
9
10
    public function testInternalVariableArgument()
11
    {
12
        $schema    = new Issue109Schema();
13
        $processor = new Processor($schema);
14
        $response  = $processor->processPayload('
15
query ($postId: Int, $commentId: Int) { 
16
    latestPost(id: $postId) { 
17
        id(comment_id: $commentId),
18
        comments(comment_id: $commentId) {
19
            comment_id
20
        } 
21
    } 
22
}',
23
            [
24
                'postId'    => 1,
25
                'commentId' => 100
26
            ])->getResponseData();
27
        $this->assertEquals(['data' => ['latestPost' => [
28
            'id'       => 1,
29
            'comments' => [
30
                ['comment_id' => 100]
31
            ]
32
        ]]], $response);
33
    }
34
}
35