public function testToString() { $types = array('test' => SORT_STRING); $types = array('test' => SORT_STRING, 'test()' => SORT_NUMERIC); $translations = array('test()' => 'abc($1,$2)'); $object = new MW_Common_Criteria_Expression_Sort_Lucene('-', 'test'); $this->assertEquals(', "test",2,3', $object->toString($types)); $object = new MW_Common_Criteria_Expression_Sort_Lucene('+', 'test("123", 1.23)'); $this->assertEquals(', "abc(123,1.23)",1,4', $object->toString($types, $translations)); }
/** * Returns the available compare, combine and sort operators. * * @return array Associative list of lists (compare, combine, sort) containing the available operators */ public function getOperators() { return array('combine' => MW_Common_Criteria_Expression_Combine_Lucene::getOperators(), 'compare' => MW_Common_Criteria_Expression_Compare_Lucene::getOperators(), 'sort' => MW_Common_Criteria_Expression_Sort_Lucene::getOperators()); }