We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| @@ 77-97 (lines=21) @@ | ||
| 74 | $this->assertResponse($this->userNameQuery, [], static::ANONYMOUS_USER, 'access'); |
|
| 75 | } |
|
| 76 | ||
| 77 | public function testNotAuthenticatedUserAccessToUserName() |
|
| 78 | { |
|
| 79 | $expected = [ |
|
| 80 | 'data' => [ |
|
| 81 | 'user' => [ |
|
| 82 | 'name' => null, |
|
| 83 | ], |
|
| 84 | ], |
|
| 85 | 'extensions' => [ |
|
| 86 | 'warnings' => [ |
|
| 87 | [ |
|
| 88 | 'message' => 'Access denied to this field.', |
|
| 89 | 'locations' => [['line' => 1, 'column' => 16]], |
|
| 90 | 'path' => ['user', 'name'], |
|
| 91 | ], |
|
| 92 | ], |
|
| 93 | ], |
|
| 94 | ]; |
|
| 95 | ||
| 96 | $this->assertResponse($this->userNameQuery, $expected, static::ANONYMOUS_USER, 'access'); |
|
| 97 | } |
|
| 98 | ||
| 99 | public function testFullyAuthenticatedUserAccessToUserName() |
|
| 100 | { |
|
| @@ 135-166 (lines=32) @@ | ||
| 132 | $this->assertResponse($this->userRolesQuery, $expected, static::USER_ADMIN, 'access'); |
|
| 133 | } |
|
| 134 | ||
| 135 | public function testUserForbiddenField() |
|
| 136 | { |
|
| 137 | $expected = [ |
|
| 138 | 'data' => [ |
|
| 139 | 'user' => null, |
|
| 140 | ], |
|
| 141 | 'extensions' => [ |
|
| 142 | 'warnings' => [ |
|
| 143 | [ |
|
| 144 | 'message' => 'Access denied to this field.', |
|
| 145 | 'locations' => [ |
|
| 146 | [ |
|
| 147 | 'line' => 3, |
|
| 148 | 'column' => 5, |
|
| 149 | ], |
|
| 150 | ], |
|
| 151 | 'path' => ['user', 'forbidden'], |
|
| 152 | ], |
|
| 153 | ], |
|
| 154 | ], |
|
| 155 | ]; |
|
| 156 | ||
| 157 | $query = <<<'EOF' |
|
| 158 | query MyQuery { |
|
| 159 | user { |
|
| 160 | forbidden |
|
| 161 | } |
|
| 162 | } |
|
| 163 | EOF; |
|
| 164 | ||
| 165 | $this->assertResponse($query, $expected, static::USER_ADMIN, 'access'); |
|
| 166 | } |
|
| 167 | ||
| 168 | public function testUserAccessToUserFriends() |
|
| 169 | { |
|