public function testToArray()
 {
     $field = 'name';
     $regexp = 'ruf';
     $filter = new Regexp($field, $regexp);
     $expectedArray = array('regexp' => array($field => $regexp));
     $this->assertequals($expectedArray, $filter->toArray());
 }
Esempio n. 2
0
 /**
  * @group unit
  */
 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());
 }