Skip to content

Commit e9f1b8c

Browse files
committed
tests: rename GraphQL query and test to make more sense in relation to the other tests
1 parent 049118e commit e9f1b8c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

tests/Database/SelectFieldsTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Rebing\GraphQL\Tests\Support\Queries\PostQuery;
1111
use Rebing\GraphQL\Tests\Support\Types\PostWithModelType;
1212
use Rebing\GraphQL\Tests\Support\Traits\SqlAssertionTrait;
13-
use Rebing\GraphQL\Tests\Support\Queries\PostWithSelectFieldsQuery;
13+
use Rebing\GraphQL\Tests\Support\Queries\PostWithSelectFieldsAndModelQuery;
1414
use Rebing\GraphQL\Tests\Support\Queries\PostWithSelectFieldsNoModelQuery;
1515

1616
class SelectFieldsTest extends TestCaseDatabase
@@ -56,15 +56,15 @@ public function testWithoutSelectFields(): void
5656
$this->assertEquals($expectedResult, $response->json());
5757
}
5858

59-
public function testWithSelectFields(): void
59+
public function testWithSelectFieldsAndModel(): void
6060
{
6161
$post = factory(Post::class)->create([
6262
'title' => 'Title of the post',
6363
]);
6464

6565
$graphql = <<<GRAQPHQL
6666
{
67-
postWithSelectFields(id: $post->id) {
67+
postWithSelectFieldsAndModel(id: $post->id) {
6868
id
6969
title
7070
}
@@ -84,7 +84,7 @@ public function testWithSelectFields(): void
8484

8585
$expectedResult = [
8686
'data' => [
87-
'postWithSelectFields' => [
87+
'postWithSelectFieldsAndModel' => [
8888
'id' => '1',
8989
'title' => 'Title of the post',
9090
],
@@ -141,7 +141,7 @@ protected function getEnvironmentSetUp($app)
141141
$app['config']->set('graphql.schemas.default', [
142142
'query' => [
143143
PostQuery::class,
144-
PostWithSelectFieldsQuery::class,
144+
PostWithSelectFieldsAndModelQuery::class,
145145
PostWithSelectFieldsNoModelQuery::class,
146146
],
147147
]);

tests/Support/Queries/PostWithSelectFieldsQuery.php renamed to tests/Support/Queries/PostWithSelectFieldsAndModelQuery.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
use Rebing\GraphQL\Support\Facades\GraphQL;
1111
use Rebing\GraphQL\Tests\Support\Models\Post;
1212

13-
class PostWithSelectFieldsQuery extends Query
13+
class PostWithSelectFieldsAndModelQuery extends Query
1414
{
1515
protected $attributes = [
16-
'name' => 'postWithSelectFields',
16+
'name' => 'postWithSelectFieldsAndModel',
1717
];
1818

1919
public function type()

0 commit comments

Comments
 (0)