Skip to content

Commit

Permalink
Added availability to specify regexp options testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurimas Niekis committed Apr 14, 2014
1 parent 074ce1e commit b888387
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/lib/Elastica/Test/Filter/RegexpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down

0 comments on commit b888387

Please sign in to comment.