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..24000e35 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,30 +20,42 @@ 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')]; + $old = [1 => ['A', 'E', 'I', 'O', 'U']]; $expected = ['a' => 1, 'e' => 1, 'i' => 1, 'o' => 1, 'u' => 1]; $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')]; + $old = [1 => ['A', 'E'], 2 => ['D', 'G']]; $expected = ['a' => 1, 'e' => 1, 'd' => 2, 'g' => 2]; $this->assertEquals($expected, transform($old)); } + /** + * uuid 5db8ea89-ecb4-4dcd-902f-2b418cc87b9d + * @testdox multiple scores with differing numbers of letters + */ 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,