From 00ee3e61318957f86466efbdfe54c799fc12e3c9 Mon Sep 17 00:00:00 2001 From: Alex Tkachev Date: Tue, 18 Apr 2023 16:17:07 +0300 Subject: [PATCH] test(Condition): test a single condition --- tests/src/Kernel/ResolverBuilderTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/src/Kernel/ResolverBuilderTest.php b/tests/src/Kernel/ResolverBuilderTest.php index dd4808e33..285b1951c 100644 --- a/tests/src/Kernel/ResolverBuilderTest.php +++ b/tests/src/Kernel/ResolverBuilderTest.php @@ -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 = <<assertResults($query, [], ['me' => NULL]); + } + /** * @covers ::cond */