Skip to content

Commit 4580405

Browse files
committed
2 parents 58e7a02 + 5950579 commit 4580405

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/StoryblokUtils.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,22 @@ public static function getPlanDescription(int|string $planLevel): string
2727
1,"1" => 'Standard Space',
2828
1000, "1000" => 'Development',
2929
100, "100" => 'Community',
30+
1100, "1100" => 'Starter (Plan 1)',
3031
200, "200" => 'Entry',
32+
999, "999" => 'Development Plan',
33+
1200, "1200" => "Growth (Plan 2i)",
34+
1300, "1300" => "Growth Plus (Plan 2ii)",
3135
300, "300" => 'Teams',
3236
301, "301" => 'Business',
37+
1400, "1400" => "Premium (Plan 3)",
38+
1401, "1401" => "Premium CN (Plan 3 CN)",
39+
1500, "1500" => "Elite (Plan 4)",
40+
1501, "1501" => "Elite CN (Plan 4 CN)",
3341
400, "400" => 'Enterprise',
3442
500, "500" => 'Enterprise Plus',
3543
501, "501" => 'Enterprise Essentials',
3644
502, "502" => 'Enterprise Scale',
3745
503, "503" => 'Enterprise Ultimate',
38-
3946
default => $planLevel,
4047
};
4148

tests/Unit/StoryblokUtilsTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,17 @@
2020
['NOTVALID', 'https://mapi.storyblok.com'],
2121

2222
]);
23+
24+
test('Testing getPlanDescription', function ($code, $description): void {
25+
expect(StoryblokUtils::getPlanDescription($code))->toBe($description);
26+
})->with([
27+
['999', 'Development Plan'],
28+
[999, 'Development Plan'],
29+
[12345, '12345'], // not listed, returning just the code
30+
[1200, 'Growth (Plan 2i)'],
31+
[1300, 'Growth Plus (Plan 2ii)'],
32+
[1400, 'Premium (Plan 3)'],
33+
[1401, 'Premium CN (Plan 3 CN)'],
34+
[1500, 'Elite (Plan 4)'],
35+
[1501, 'Elite CN (Plan 4 CN)'],
36+
]);

0 commit comments

Comments
 (0)