Completed
Push — master ( 29ef50...718f9d )
by Alexandr
03:01
created

Issue109Test::testInternalVariableArgument()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 12

Duplication

Lines 23
Ratio 100 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 23
loc 23
rs 9.0856
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 View Code Duplication
    public function testInternalVariableArgument()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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), comments(comment_id: $commentId) {
18
            comment_id
19
        } 
20
    } 
21
}',
22
            [
23
                'postId'    => 1,
24
                'commentId' => 100
25
            ])->getResponseData();
26
        $this->assertEquals(['data' => ['latestPost' => [
27
            'id'       => 1,
28
            'comments' => [
29
                ['comment_id' => 100]
30
            ]
31
        ]]], $response);
32
    }
33
}