diff --git a/CHANGELOG.md b/CHANGELOG.md index fb39fed..169617b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 1.0.4 - WIP - Adding `hasTags()`, `tagListAsString()`, `tagListAsArray()` methods for stories +- Adding `ownerId()` method to Space class ## 1.0.3 - 2025-09-29 - Adding new parameter for duplicating space (for adding the space in the organization) diff --git a/src/Data/Space.php b/src/Data/Space.php index f29232d..04513f5 100644 --- a/src/Data/Space.php +++ b/src/Data/Space.php @@ -77,4 +77,9 @@ public function planDescription(): null|string { return StoryblokUtils::getPlanDescription($this->planLevel()); } + + public function ownerId(): string + { + return $this->getString('owner_id', ""); + } } diff --git a/tests/Feature/SpaceTest.php b/tests/Feature/SpaceTest.php index 91635e3..c0159c5 100644 --- a/tests/Feature/SpaceTest.php +++ b/tests/Feature/SpaceTest.php @@ -40,6 +40,7 @@ expect($storyblokData->get("name")) ->toBe("Example Space") ->and($storyblokData->name())->toBe("Example Space") + ->and($storyblokData->ownerId())->toBe("1114") ->and($storyblokData->id())->toBe("680") ->and($storyblokData->createdAt())->toBe("2018-11-10") ->and($storyblokData->planDescription())->toBe("Starter (Trial)") @@ -198,7 +199,9 @@ ->and($storyblokResponse->getResponseStatusCode())->toBe(200); foreach ($storyblokData as $spaceItem) { expect($spaceItem->name()) - ->toBeString(); + ->toBeString() + ->and($spaceItem->ownerId())->toBe("1114"); + } expect($storyblokData->howManySpaces())->toBe(2);