From cb552a7191d28d641a7b1f83a05b37cd22597c9c Mon Sep 17 00:00:00 2001 From: david Date: Wed, 20 Mar 2024 14:08:57 +0100 Subject: [PATCH] #12 expand test to cover random variation building --- .../Component/ComponentItemFactoryTest.php | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/Unit/Component/ComponentItemFactoryTest.php b/tests/Unit/Component/ComponentItemFactoryTest.php index 4e633cf..fdade96 100644 --- a/tests/Unit/Component/ComponentItemFactoryTest.php +++ b/tests/Unit/Component/ComponentItemFactoryTest.php @@ -114,6 +114,35 @@ public static function getValidComponents(): iterable ], ], ]; + + yield 'Component without variations' => [ + [ + 'name' => 'Component1', + 'title' => 'Component', + 'description' => 'Test component', + 'category' => 'TestCategory', + 'sub_category' => 'SubCategory', + 'parameters' => [ + 'one' => 'String', + 'two' => 'float', + 'three' => 'integer', + 'four' => 'int', + 'five' => 'double', + 'six' => 'bool', + 'seven' => 'boolean', + 'eight' => 'SomeOtherType', + ], + ], + ]; + + yield 'Component without parameters and variations' => [ + [ + 'name' => 'Component1', + 'title' => 'Component', + 'description' => 'Test component', + 'category' => 'TestCategory', + ], + ]; } private function getComponentCategoryMock(string $category, ?string $subCategory = null): ComponentCategory