Skip to content

Commit

Permalink
Add controller test
Browse files Browse the repository at this point in the history
  • Loading branch information
enjinabner committed Jul 13, 2023
1 parent 0648247 commit ce64044
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 1 deletion.
140 changes: 140 additions & 0 deletions tests/Feature/Controllers/GraphQLControllerTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<?php

namespace Enjin\Platform\Tests\Feature\Controllers;

use Enjin\Platform\Tests\Feature\GraphQL\TestCaseGraphQL;
use Enjin\Platform\Tests\Feature\GraphQL\Traits\HasHttp;

class GraphQLControllerTest extends TestCaseGraphQL
{
use HasHttp;

public function test_it_can_query_introspsection(): void
{
$response = $this->json(
'POST',
'/graphql',
['query' => '
query IntrospectionQuery {
__schema {
queryType
{
name
}
mutationType
{
name
}
types
{
...FullType
}
directives
{
name
description
locations
args
{
...InputValue
}
}
}
}
fragment FullType on __Type
{
kind
name
description
fields(includeDeprecated: true)
{
name
description
args
{
...InputValue
}
type
{
...TypeRef
}
isDeprecated
deprecationReason
}
inputFields
{
...InputValue
}
interfaces
{
...TypeRef
}
enumValues(includeDeprecated: true)
{
name
description
isDeprecated
deprecationReason
}
possibleTypes
{
...TypeRef
}
}
fragment InputValue on __InputValue
{
name
description
type
{
...TypeRef
}
defaultValue
}
fragment TypeRef on __Type
{
kind
name
ofType
{
kind
name
ofType
{
kind
name
ofType
{
kind
name
ofType
{
kind
name
ofType
{
kind
name
ofType
{
kind
name
ofType
{
kind
name
}
}
}
}
}
}
}
}
',
]
);

$this->assertTrue($response->isOk());
}
}
2 changes: 1 addition & 1 deletion tests/Feature/Controllers/PlatformControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class PlatformControllerTest extends TestCaseGraphQL
public function test_it_can_get_platform_info(): void
{
$response = $this->json('GET', '/.well-known/enjin-platform.json');
$this->assertTrue($response->getStatusCode() === 200);
$this->assertTrue($response->isOk());
$this->assertEquals(
[
'root' => 'enjin/platform-core',
Expand Down

0 comments on commit ce64044

Please sign in to comment.