public function testToArray()
 {
     $field = 'test';
     $testQuery = 'Nicolas Ruflin';
     $type = 'phrase';
     $operator = 'and';
     $analyzer = 'myanalyzer';
     $boost = 2.0;
     $minimumShouldMatch = 2;
     $fuzziness = 0.3;
     $fuzzyRewrite = 'constant_score_boolean';
     $prefixLength = 3;
     $maxExpansions = 12;
     $query = new Match();
     $query->setFieldQuery($field, $testQuery);
     $query->setFieldType($field, $type);
     $query->setFieldOperator($field, $operator);
     $query->setFieldAnalyzer($field, $analyzer);
     $query->setFieldBoost($field, $boost);
     $query->setFieldMinimumShouldMatch($field, $minimumShouldMatch);
     $query->setFieldFuzziness($field, $fuzziness);
     $query->setFieldFuzzyRewrite($field, $fuzzyRewrite);
     $query->setFieldPrefixLength($field, $prefixLength);
     $query->setFieldMaxExpansions($field, $maxExpansions);
     $expectedArray = array('match' => array($field => array('query' => $testQuery, 'type' => $type, 'operator' => $operator, 'analyzer' => $analyzer, 'boost' => $boost, 'minimum_should_match' => $minimumShouldMatch, 'fuzziness' => $fuzziness, 'fuzzy_rewrite' => $fuzzyRewrite, 'prefix_length' => $prefixLength, 'max_expansions' => $maxExpansions)));
     $this->assertEquals($expectedArray, $query->toArray());
 }
 /**
  * @group unit
  */
 public function testConstruct()
 {
     $match = new Match(null, 'values');
     $this->assertEquals(array('match' => array()), $match->toArray());
     $match = new Match('field', null);
     $this->assertEquals(array('match' => array()), $match->toArray());
     $match1 = new Match('field', 'values');
     $match2 = new Match();
     $match2->setField('field', 'values');
     $this->assertEquals($match1->toArray(), $match2->toArray());
 }