Skip to content

Commit abcb8fa

Browse files
committed
test(Condition): test a single condition
1 parent 871a1b4 commit abcb8fa

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/src/Kernel/ResolverBuilderTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,26 @@ public function testFromContext(): void {
231231
$this->assertResults($query, [], ['tree' => ['context' => ['myContext' => 'my context value']]]);
232232
}
233233

234+
/**
235+
* @covers ::cond
236+
*/
237+
public function testSingleCond(): void {
238+
$this->mockResolver('Query', 'me', $this->builder->cond([
239+
[
240+
$this->builder->fromValue(FALSE),
241+
$this->builder->fromValue('This should resolve into null.'),
242+
],
243+
]));
244+
245+
$query = <<<GQL
246+
query {
247+
me
248+
}
249+
GQL;
250+
251+
$this->assertResults($query, [], ['me' => NULL]);
252+
}
253+
234254
/**
235255
* @covers ::cond
236256
*/

0 commit comments

Comments
 (0)