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

Issue109Test   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 28
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B testInternalVariableArgument() 0 24 1
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