Skip to content

Commit

Permalink
fix folder type issue
Browse files Browse the repository at this point in the history
add get folder test
  • Loading branch information
Infamoustrey committed Dec 30, 2020
1 parent 8365759 commit 539eca5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/SmartsheetClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function getRow(string $sheetId, string $rowId): Row
*/
public function getFolder(string $folderId): Folder
{
return new Folder($this, $this->get("folders/$folderId"));
return new Folder($this, (array) $this->get("folders/$folderId"));
}

/**
Expand Down
5 changes: 5 additions & 0 deletions tests/SheetsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ protected function getClient(): SmartsheetClient
return new SmartsheetClient(['token' => getenv('SMARTSHEET_API_TOKEN')]);
}

public function testCanFetchFolder(): void {
$folder = $this->getClient()->getFolder('2877722042099588');
$this->assertNotNull($folder);
}

public function testCanFetchSheets(): void
{
$sheetList = $this->getClient()->listSheets();
Expand Down

0 comments on commit 539eca5

Please sign in to comment.