1,'name'=>'test1')), new Solarium_Document_ReadOnly(array('id'=>2,'name'=>'test2')), ); $this->_results = array( 'key1' => new Solarium_Result_Select_MoreLikeThis_Result(2, 5.13, $docs), 'key2' => new Solarium_Result_Select_MoreLikeThis_Result(2, 2.3, $docs), ); $this->_mlt = new Solarium_Result_Select_MoreLikeThis($this->_results); } public function testGetResults() { $this->assertEquals($this->_results, $this->_mlt->getResults()); } public function testGetResult() { $this->assertEquals( $this->_results['key1'], $this->_mlt->getResult('key1') ); } public function testGetInvalidResult() { $this->assertEquals( null, $this->_mlt->getResult('invalid') ); } public function testIterator() { $items = array(); foreach($this->_mlt AS $key => $item) { $items[$key] = $item; } $this->assertEquals($this->_results, $items); } public function testCount() { $this->assertEquals(count($this->_results), count($this->_mlt)); } }