_data = array( 'term1' => 'data1', 'term2' => 'data2', ); $this->_collation = 'collation result'; $this->_result = new Solarium_Result_SuggesterDummy($this->_data, $this->_collation); } public function testGetStatus() { $this->assertEquals( 1, $this->_result->getStatus() ); } public function testGetQueryTime() { $this->assertEquals( 12, $this->_result->getQueryTime() ); } public function testGetResults() { $this->assertEquals($this->_data, $this->_result->getResults()); } public function testGetTerm() { $this->assertEquals($this->_data['term1'], $this->_result->getTerm('term1')); } public function testGetTermsWithInvalidFieldName() { $this->assertEquals(array(), $this->_result->getTerm('term3')); } public function testCount() { $this->assertEquals(count($this->_data), count($this->_result)); } public function testIterator() { $results = array(); foreach($this->_result AS $key => $doc) { $results[$key] = $doc; } $this->assertEquals($this->_data, $results); } public function testGetCollation() { $this->assertEquals($this->_collation, $this->_result->getCollation()); } } class Solarium_Result_SuggesterDummy extends Solarium_Result_Suggester { protected $_parsed = true; public function __construct($results, $collation) { $this->_results = $results; $this->_collation = $collation; $this->_status = 1; $this->_queryTime = 12; } }