Get a worksheet by title (name)
public getByTitle ( string $title ) : |
||
$title | string | name of the worksheet |
Résultat |
public function testGetByTitle() { $xml = file_get_contents(__DIR__ . '/xml/worksheet-feed.xml'); $worksheetFeed = new WorksheetFeed($xml); $this->assertTrue($worksheetFeed->getByTitle('Sheet1') instanceof Worksheet); $this->assertTrue(is_null($worksheetFeed->getByTitle('Sheet3'))); }
/** * @expectedException Google\Spreadsheet\Exception\WorksheetNotFoundException */ public function testGetByTitleException() { $worksheetFeed = new WorksheetFeed($this->getSimpleXMLElement("worksheet-feed")); $this->assertNull($worksheetFeed->getByTitle("Sheet3")); }