From 539eca517f38c63235e9fefc0307464947e7153d Mon Sep 17 00:00:00 2001 From: Trey Foster Date: Wed, 30 Dec 2020 09:52:36 -0600 Subject: [PATCH] fix folder type issue add get folder test --- src/SmartsheetClient.php | 2 +- tests/SheetsTest.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/SmartsheetClient.php b/src/SmartsheetClient.php index b580d5a..bebef98 100644 --- a/src/SmartsheetClient.php +++ b/src/SmartsheetClient.php @@ -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")); } /** diff --git a/tests/SheetsTest.php b/tests/SheetsTest.php index 93dd45d..ef6d269 100644 --- a/tests/SheetsTest.php +++ b/tests/SheetsTest.php @@ -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();