From cc0c0b2cf39151800b2f97c12f12b22817647d44 Mon Sep 17 00:00:00 2001 From: resu-xuniL Date: Mon, 25 May 2026 17:37:46 +0200 Subject: [PATCH 1/2] Lucky-number TestDox is more detailed (arrays) --- .../concept/lucky-numbers/LuckyNumbersTest.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/exercises/concept/lucky-numbers/LuckyNumbersTest.php b/exercises/concept/lucky-numbers/LuckyNumbersTest.php index ad55249e..aff8ca32 100644 --- a/exercises/concept/lucky-numbers/LuckyNumbersTest.php +++ b/exercises/concept/lucky-numbers/LuckyNumbersTest.php @@ -15,10 +15,12 @@ public static function setUpBeforeClass(): void * @task_id 1 */ #[DataProvider('sumUpTestCases')] - #[TestDox('Sums up $digitsOfNumber1 and $digitsOfNumber2 to $expected')] + #[TestDox('Sums up array [$imploded_digitsOfNumber1] and array [$imploded_digitsOfNumber2] to $expected')] public function testSumUp( array $digitsOfNumber1, + string $imploded_digitsOfNumber1, array $digitsOfNumber2, + string $imploded_digitsOfNumber2, int $expected ): void { $class = new LuckyNumbers(); @@ -31,13 +33,13 @@ public function testSumUp( public static function sumUpTestCases() { return [ - 'both numbers same length 1' => [ [2], [7], 9 ], - 'both numbers same length 2' => [ [2, 4], [5, 7], 81 ], - 'both numbers same length 3' => [ [5, 3, 4], [3, 6, 2], 896 ], - 'first shorter than second number' => [ [2, 4], [1, 5, 7], 181 ], - 'first longer than second number' => [ [2, 2, 5], [5, 7], 282 ], - 'handles overflow' => [ [9, 9, 9], [1, 0, 1], 1100 ], - 'handles large numbers' => [ [9, 9, 9, 9, 9, 9], [1], 1000000 ], + 'both numbers same length 1' => [ [2], "2", [7], "7", 9 ], + 'both numbers same length 2' => [ [2, 4], "2, 4", [5, 7], "5, 7", 81 ], + 'both numbers same length 3' => [ [5, 3, 4], "5, 3, 4", [3, 6, 2], "3, 6, 2", 896 ], + 'first shorter than second number' => [ [2, 4], "2, 4", [1, 5, 7], "1, 5, 7", 181 ], + 'first longer than second number' => [ [2, 2, 5], "2, 2, 5", [5, 7], "5, 7", 282 ], + 'handles overflow' => [ [9, 9, 9], "9, 9, 9", [1, 0, 1], "1, 0, 1", 1100 ], + 'handles large numbers' => [ [9, 9, 9, 9, 9, 9], "9, 9, 9, 9, 9, 9", [1], "1", 1000000 ], ]; } From a9738bc86ef0b61f0ba21f72293f013e778bc270 Mon Sep 17 00:00:00 2001 From: resu-xuniL Date: Mon, 25 May 2026 17:45:49 +0200 Subject: [PATCH 2/2] fix indent lines --- exercises/concept/lucky-numbers/LuckyNumbersTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/concept/lucky-numbers/LuckyNumbersTest.php b/exercises/concept/lucky-numbers/LuckyNumbersTest.php index aff8ca32..e1012786 100644 --- a/exercises/concept/lucky-numbers/LuckyNumbersTest.php +++ b/exercises/concept/lucky-numbers/LuckyNumbersTest.php @@ -18,9 +18,9 @@ public static function setUpBeforeClass(): void #[TestDox('Sums up array [$imploded_digitsOfNumber1] and array [$imploded_digitsOfNumber2] to $expected')] public function testSumUp( array $digitsOfNumber1, - string $imploded_digitsOfNumber1, + string $imploded_digitsOfNumber1, array $digitsOfNumber2, - string $imploded_digitsOfNumber2, + string $imploded_digitsOfNumber2, int $expected ): void { $class = new LuckyNumbers();