_query = new Solarium_Query_Terms; $this->_builder = new Solarium_Client_RequestBuilder_Terms; } public function testBuildParams() { $this->_query->setFields('fieldA, fieldB'); $this->_query->setLowerbound('d'); $this->_query->setLowerboundInclude(true); $this->_query->setMinCount(3); $this->_query->setMaxCount(100); $this->_query->setPrefix('de'); $this->_query->setRegex('det.*'); $this->_query->setRegexFlags('case_insensitive,comments'); $this->_query->setLimit(50); $this->_query->setUpperbound('x'); $this->_query->setUpperboundInclude(false); $this->_query->setRaw(false); $this->_query->setSort('index'); $request = $this->_builder->build($this->_query); $this->assertEquals( array( 'terms' => 'true', 'terms.fl' => array( 'fieldA', 'fieldB', ), 'terms.limit' => 50, 'terms.lower' => 'd', 'terms.lower.incl' => 'true', 'terms.maxcount' => 100, 'terms.mincount' => 3, 'terms.prefix' => 'de', 'terms.raw' => 'false', 'terms.regex' => 'det.*', 'terms.regex.flag' => array( 'case_insensitive', 'comments', ), 'terms.sort' => 'index', 'terms.upper' => 'x', 'terms.upper.incl' => 'false', 'wt' => 'json', ), $request->getParams() ); $this->assertEquals( Solarium_Client_Request::METHOD_GET, $request->getMethod() ); } }