Skip to content

Commit

Permalink
code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dbosen committed Nov 21, 2023
1 parent 3217393 commit 351f660
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions modules/thunder_gqls/tests/src/Functional/SchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ public function testValidSchema(): void {
$this->assertEmpty($validator->getMissingResolvers($server), "The schema 'thunder_graphql' contains types without a resolver.");
}

/**
* Tests query of an unpublished channel.
*/
public function testLabelAccess(): void {
$this->loadTermByUuid('bfc251bc-de35-467d-af44-1f7a7012b845')
->setUnpublished()
Expand All @@ -164,8 +167,10 @@ public function testLabelAccess(): void {
$query = <<<GQL
query (\$path: String!) {
page(path: \$path) {
channel: {
name
... on Article {
channel {
name
}
}
}
}
Expand All @@ -174,7 +179,10 @@ public function testLabelAccess(): void {
$variables = ['path' => 'duis-autem-vel-eum-iriure'];
$response = $this->query($query, Json::encode($variables));
$this->assertEquals(200, $response->getStatusCode(), 'Response not 200');
$this->assertArrayHasKey('name', $this->jsonDecode($response->getBody())['data']['page']['channel']);
$this->assertEmpty($this->jsonDecode($response->getBody())['data']['page']['channel']['name']);

$page = $this->jsonDecode($response->getBody());
file_put_contents('test-output.txt', print_r($page, TRUE));

}

}

0 comments on commit 351f660

Please sign in to comment.