Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Push — master ( 024700...341ac6 )
by Jérémiah
04:30
created

testIncludesConnectionAndEdgeFields()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 42
Code Lines 16

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 42
rs 8.8571
cc 1
eloc 16
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the OverblogGraphQLBundle package.
5
 *
6
 * (c) Overblog <http://github.com/overblog/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Overblog\GraphQLBundle\Tests\Functional\Relay\Connection;
13
14
use Overblog\GraphQLBundle\Tests\Functional\TestCase;
15
16
/**
17
 * Class ConnectionTest.
18
 *
19
 * @see https://github.com/graphql/graphql-relay-js/blob/master/src/connection/__tests__/connection.js
20
 */
21
class ConnectionTest extends TestCase
22
{
23
    protected function setUp()
24
    {
25
        parent::setUp();
26
27
        static::createAndBootKernel(['test_case' => 'connection']);
28
    }
29
30
    public function testIncludesConnectionAndEdgeFields()
31
    {
32
        $query = <<<EOF
33
query FriendsQuery {
34
  user {
35
    friends(first: 2) {
36
      totalCount
37
      edges {
38
        friendshipTime
39
        node {
40
          name
41
        }
42
      }
43
    }
44
  }
45
}
46
EOF;
47
48
        $expectedData = [
49
            'user' => [
50
                'friends' => [
51
                   'totalCount' => 4,
52
                    'edges' => [
53
                        [
54
                            'friendshipTime' => 'Yesterday',
55
                            'node' => [
56
                                'name' => 'Nick',
57
                            ],
58
                        ],
59
                        [
60
                            'friendshipTime' => 'Yesterday',
61
                            'node' => [
62
                                'name' => 'Lee',
63
                            ],
64
                        ],
65
                    ],
66
                ],
67
            ],
68
        ];
69
70
        $this->assertGraphQL($query, $expectedData);
71
    }
72
73 View Code Duplication
    public function testWorksWithForwardConnectionArgs()
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...
74
    {
75
        $query = <<<EOF
76
query FriendsQuery {
77
  user {
78
    friendsForward(first: 2) {
79
      edges {
80
        node {
81
          name
82
        }
83
      }
84
    }
85
  }
86
}
87
EOF;
88
89
        $expectedData = [
90
            'user' => [
91
                'friendsForward' => [
92
                    'edges' => [
93
                        [
94
                            'node' => [
95
                                'name' => 'Nick',
96
                            ],
97
                        ],
98
                        [
99
                            'node' => [
100
                                'name' => 'Lee',
101
                            ],
102
                        ],
103
                    ],
104
                ],
105
            ],
106
        ];
107
108
        $this->assertGraphQL($query, $expectedData);
109
    }
110
111 View Code Duplication
    public function testWorksWithBackwardConnectionArgs()
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...
112
    {
113
        $query = <<<EOF
114
      query FriendsQuery {
115
        user {
116
          friendsBackward(last: 2) {
117
            edges {
118
              node {
119
                name
120
              }
121
            }
122
          }
123
        }
124
      }
125
EOF;
126
127
        $expectedData = [
128
            'user' => [
129
                'friendsBackward' => [
130
                    'edges' => [
131
                        [
132
                            'node' => [
133
                                'name' => 'Joe',
134
                            ],
135
                        ],
136
                        [
137
                            'node' => [
138
                                'name' => 'Tim',
139
                            ],
140
                        ],
141
                    ],
142
                ],
143
            ],
144
        ];
145
146
        $this->assertGraphQL($query, $expectedData);
147
    }
148
}
149