diff --git a/test/lib/Elastica/Test/Filter/RegexpTest.php b/test/lib/Elastica/Test/Filter/RegexpTest.php index e06064dd12..d954ca71ff 100644 --- a/test/lib/Elastica/Test/Filter/RegexpTest.php +++ b/test/lib/Elastica/Test/Filter/RegexpTest.php @@ -24,6 +24,28 @@ public function testToArray() $this->assertequals($expectedArray, $filter->toArray()); } + + public function testToArrayWithOptions() + { + $field = 'name'; + $regexp = 'ruf'; + $options = array( + 'flags' => 'ALL' + ); + + $filter = new Regexp($field, $regexp, $options); + + $expectedArray = array( + 'regexp' => array( + $field => array( + 'value' => $regexp, + 'flags' => 'ALL' + ) + ) + ); + + $this->assertequals($expectedArray, $filter->toArray()); + } public function testDifferentRegexp() {