public function getById($id)
{
$feedId = $this->xml->id->__toString();
foreach ($this->xml->entry as $entry) {
if ($entry->id == $feedId . '/' . $id) {
return new Worksheet($entry);
}
}
throw new WorksheetNotFoundException();
}
/** * @expectedException Google\Spreadsheet\Exception\WorksheetNotFoundException */ public function testGetByIdException() { $worksheetFeed = new WorksheetFeed($this->getSimpleXMLElement("worksheet-feed")); $this->assertTrue(is_null($worksheetFeed->getById("od7"))); }