From 693fbb5469770917c1ec48cdc881b02c2b3e7db7 Mon Sep 17 00:00:00 2001 From: Tomas Norre Mikkelsen Date: Tue, 19 Nov 2024 18:47:15 +0100 Subject: [PATCH 1/3] sync etl --- exercises/practice/etl/.meta/config.json | 6 ++-- exercises/practice/etl/.meta/example.php | 22 -------------- exercises/practice/etl/EtlTest.php | 38 ++++++++++-------------- 3 files changed, 19 insertions(+), 47 deletions(-) diff --git a/exercises/practice/etl/.meta/config.json b/exercises/practice/etl/.meta/config.json index be1ecf51..1288562f 100644 --- a/exercises/practice/etl/.meta/config.json +++ b/exercises/practice/etl/.meta/config.json @@ -19,7 +19,7 @@ ".meta/example.php" ] }, - "blurb": "We are going to do the `Transform` step of an Extract-Transform-Load.", - "source": "The Jumpstart Lab team", - "source_url": "https://jumpstartlab.com" + "blurb": "Change the data format for scoring a game to more easily add other languages.", + "source": "Based on an exercise by the JumpstartLab team for students at The Turing School of Software and Design.", + "source_url": "https://turing.edu" } diff --git a/exercises/practice/etl/.meta/example.php b/exercises/practice/etl/.meta/example.php index 611723a4..fe137af5 100644 --- a/exercises/practice/etl/.meta/example.php +++ b/exercises/practice/etl/.meta/example.php @@ -1,27 +1,5 @@ . - * - * To disable strict typing, comment out the directive below. - */ - declare(strict_types=1); function transform($old) diff --git a/exercises/practice/etl/EtlTest.php b/exercises/practice/etl/EtlTest.php index 93aff504..c3278939 100644 --- a/exercises/practice/etl/EtlTest.php +++ b/exercises/practice/etl/EtlTest.php @@ -1,27 +1,5 @@ . - * - * To disable strict typing, comment out the directive below. - */ - declare(strict_types=1); class EtlTest extends PHPUnit\Framework\TestCase @@ -31,6 +9,10 @@ public static function setUpBeforeClass(): void require_once 'Etl.php'; } + /** + * uuid 78a7a9f9-4490-4a47-8ee9-5a38bb47d28f + * @testdox single letter + */ public function testTransformOneValue(): void { $old = ['1' => ['A']]; @@ -38,6 +20,10 @@ public function testTransformOneValue(): void $this->assertEquals($expected, transform($old)); } + /** + * uuid 60dbd000-451d-44c7-bdbb-97c73ac1f497 + * @testdox single score with multiple letters + */ public function testTransformMoreValues(): void { $old = ['1' => str_split('AEIOU')]; @@ -45,6 +31,10 @@ public function testTransformMoreValues(): void $this->assertEquals($expected, transform($old)); } + /** + * uuid f5c5de0c-301f-4fdd-a0e5-df97d4214f54 + * @testdox multiple scores with multiple letters + */ public function testTransformMoreKeys(): void { $old = ['1' => str_split('AE'), '2' => str_split('DG')]; @@ -52,6 +42,10 @@ public function testTransformMoreKeys(): void $this->assertEquals($expected, transform($old)); } + /** + * uuid 5db8ea89-ecb4-4dcd-902f-2b418cc87b9d + * @testdox multiple scores with differing numbers of letters + */ public function testTransformFullDataset(): void { $old = [ From 2e2dc7dfc5cd999244bf341291943a3080b49327 Mon Sep 17 00:00:00 2001 From: Tomas Norre Mikkelsen Date: Fri, 20 Dec 2024 16:07:12 +0100 Subject: [PATCH 2/3] Update exercises/practice/etl/EtlTest.php Co-authored-by: mk-mxp <55182845+mk-mxp@users.noreply.github.com> --- exercises/practice/etl/EtlTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/etl/EtlTest.php b/exercises/practice/etl/EtlTest.php index c3278939..3519c27b 100644 --- a/exercises/practice/etl/EtlTest.php +++ b/exercises/practice/etl/EtlTest.php @@ -26,7 +26,7 @@ public function testTransformOneValue(): void */ public function testTransformMoreValues(): void { - $old = ['1' => str_split('AEIOU')]; + $old = [1 => ["A", "E", "I", "O", "U"]]; $expected = ['a' => 1, 'e' => 1, 'i' => 1, 'o' => 1, 'u' => 1]; $this->assertEquals($expected, transform($old)); } From 8ee5de6a4df410c0dd0d3a3aaa3b2550163ffded Mon Sep 17 00:00:00 2001 From: Tomas Norre Mikkelsen Date: Fri, 20 Dec 2024 16:14:04 +0100 Subject: [PATCH 3/3] fix: update according to feedback --- exercises/practice/etl/EtlTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/exercises/practice/etl/EtlTest.php b/exercises/practice/etl/EtlTest.php index 3519c27b..24000e35 100644 --- a/exercises/practice/etl/EtlTest.php +++ b/exercises/practice/etl/EtlTest.php @@ -26,7 +26,7 @@ public function testTransformOneValue(): void */ public function testTransformMoreValues(): void { - $old = [1 => ["A", "E", "I", "O", "U"]]; + $old = [1 => ['A', 'E', 'I', 'O', 'U']]; $expected = ['a' => 1, 'e' => 1, 'i' => 1, 'o' => 1, 'u' => 1]; $this->assertEquals($expected, transform($old)); } @@ -37,7 +37,7 @@ public function testTransformMoreValues(): void */ public function testTransformMoreKeys(): void { - $old = ['1' => str_split('AE'), '2' => str_split('DG')]; + $old = [1 => ['A', 'E'], 2 => ['D', 'G']]; $expected = ['a' => 1, 'e' => 1, 'd' => 2, 'g' => 2]; $this->assertEquals($expected, transform($old)); } @@ -49,13 +49,13 @@ public function testTransformMoreKeys(): void public function testTransformFullDataset(): void { $old = [ - '1' => str_split('AEIOULNRST'), - '2' => str_split('DG'), - '3' => str_split('BCMP'), - '4' => str_split('FHVWY'), - '5' => str_split('K'), - '8' => str_split('JX'), - '10' => str_split('QZ'), + 1 => ['A', 'E', 'I', 'O', 'U', 'L', 'N', 'R', 'S', 'T'], + 2 => ['D', 'G'], + 3 => ['B', 'C', 'M', 'P'], + 4 => ['F', 'H', 'V', 'W', 'Y'], + 5 => ['K'], + 8 => ['J', 'X'], + 10 => ['Q', 'Z'], ]; $expected = [ 'a' => 1, 'b' => 3, 'c' => 3, 'd' => 2, 'e' => 1,