Skip to content

Commit 55271f2

Browse files
committed
tests: fix testWithSelectFieldsAndModelAndAlias
After #283 landed, this is now fixed and correctly resolves the alias field.
1 parent aeaa01a commit 55271f2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/Database/SelectFieldsTest.php

+10-3
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,17 @@ public function testWithSelectFieldsAndModelAndAlias(): void
125125

126126
$this->assertEquals($response->getStatusCode(), 200);
127127

128-
$result = $response->json();
128+
$expectedResult = [
129+
'data' => [
130+
'postWithSelectFieldsAndModelAndAlias' => [
131+
'id' => '1',
132+
'description' => 'Description of the post',
133+
],
134+
],
135+
];
129136

130-
$this->assertNull($result['data']['postWithSelectFieldsAndModelAndAlias']);
131-
$this->assertSame('Cannot return null for non-nullable field PostWithModelAndAlias.description.', $result['errors'][0]['debugMessage']);
137+
$this->assertEquals($response->getStatusCode(), 200);
138+
$this->assertEquals($expectedResult, $response->json());
132139
}
133140

134141
public function testWithSelectFieldsNoModel(): void

0 commit comments

Comments
 (0)