_items = array( 'key1' => 'content1', 'key2' => 'content2', ); $this->_grouping = new Solarium_Result_Select_Grouping($this->_items); } public function testGetGroups() { $this->assertEquals( $this->_items, $this->_grouping->getGroups() ); } public function testGetGroup() { $this->assertEquals( $this->_items['key1'], $this->_grouping->getGroup('key1') ); } public function testGetGroupInvalid() { $this->assertEquals( null, $this->_grouping->getGroup('invalidkey') ); } public function testIterator() { $items = array(); foreach($this->_grouping AS $key => $item) { $items[$key] = $item; } $this->assertEquals($this->_items, $items); } public function testCount() { $this->assertEquals(count($this->_items), count($this->_grouping)); } }