Skip to content

Commit

Permalink
test(Condition): test a single condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Leksat authored and Kingdutch committed Jul 26, 2023
1 parent bf9dea3 commit 00ee3e6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/src/Kernel/ResolverBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,26 @@ public function testFromContext(): void {
$this->assertResults($query, [], ['tree' => ['context' => ['myContext' => 'my context value']]]);
}

/**
* @covers ::cond
*/
public function testSingleCond(): void {
$this->mockResolver('Query', 'me', $this->builder->cond([
[
$this->builder->fromValue(FALSE),
$this->builder->fromValue('This should resolve into null.'),
],
]));

$query = <<<GQL
query {
me
}
GQL;

$this->assertResults($query, [], ['me' => NULL]);
}

/**
* @covers ::cond
*/
Expand Down

0 comments on commit 00ee3e6

Please sign in to comment.