diff --git a/tests/Parsers/FragmentParserTest.php b/tests/Parsers/FragmentParserTest.php index eb7898e..59664c9 100644 --- a/tests/Parsers/FragmentParserTest.php +++ b/tests/Parsers/FragmentParserTest.php @@ -113,4 +113,26 @@ public function testParsingAndMergingWithParent() $this->assertEquals($expectedBody, $parser->parse($body)); } + + public function testParsingCustomFragments() + { + $parser = new FragmentParser(); + + $body = [ + 'query' => [ + new IDFilter(123), + ] + ]; + $expectedBody = [ + 'query' => [ + [ + 'term' => [ + 'id' => 123 + ] + ] + ] + ]; + + $this->assertEquals($expectedBody, $parser->parse($body)); + } }