_data = array( 'fieldA' => array( 'term1', 11, 'term2', 5, 'term3', 2, ), 'fieldB' => array( 'term4', 4, 'term5', 1, ) ); $this->_result = new Solarium_Result_TermsDummy($this->_data); } 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 testGetTerms() { $this->assertEquals($this->_data['fieldA'], $this->_result->getTerms('fieldA')); } public function testGetTermsWithInvalidFieldName() { $this->assertEquals(array(), $this->_result->getTerms('fieldX')); } 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); } } class Solarium_Result_TermsDummy extends Solarium_Result_Terms { protected $_parsed = true; public function __construct($results) { $this->_results = $results; $this->_status = 1; $this->_queryTime = 12; } }