Skip to content

Commit

Permalink
FragmentParser: add test for custom fragments.
Browse files Browse the repository at this point in the history
dieterve committed Aug 21, 2015
1 parent eb2151c commit 1e4dd5d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/Parsers/FragmentParserTest.php
Original file line number Diff line number Diff line change
@@ -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));
}
}

0 comments on commit 1e4dd5d

Please sign in to comment.