/** * @return string */ public function toXml() { $xml = '<?xml version="1.0" encoding="UTF-8"?> <collection> <totalRecords>' . $this->searchResult->getSize() . '</totalRecords> <items>'; foreach ($this->searchResult->getItems() as $item) { $xml .= $item->toXml(); } $xml .= '</items> </collection>'; return $xml; }
public function testGetSize() { $size = 42; $this->query->expects($this->once())->method('getSize')->willReturn($size); $this->assertEquals($size, $this->searchResult->getSize()); }