11<?php
22
3- /*
4- * By adding type hints and enabling strict type checking, code can become
5- * easier to read, self-documenting and reduce the number of potential bugs.
6- * By default, type declarations are non-strict, which means they will attempt
7- * to change the original type to match the type specified by the
8- * type-declaration.
9- *
10- * In other words, if you pass a string to a function requiring a float,
11- * it will attempt to convert the string value to a float.
12- *
13- * To enable strict mode, a single declare directive must be placed at the top
14- * of the file.
15- * This means that the strictness of typing is configured on a per-file basis.
16- * This directive not only affects the type declarations of parameters, but also
17- * a function's return type.
18- *
19- * For more info review the Concept on strict type checking in the PHP track
20- * <link>.
21- *
22- * To disable strict typing, comment out the directive below.
23- */
24-
253declare (strict_types=1 );
264
275class DiamondTest extends PHPUnit \Framework \TestCase
@@ -31,11 +9,19 @@ public static function setUpBeforeClass(): void
319 require_once 'Diamond.php ' ;
3210 }
3311
12+ /**
13+ * uuid: 202fb4cc-6a38-4883-9193-a29d5cb92076
14+ * @testdox Degenerate case with a single 'A' row
15+ */
3416 public function testDegenerateCaseWithASingleARow (): void
3517 {
3618 $ this ->assertEquals (["A " ], diamond ("A " ));
3719 }
3820
21+ /**
22+ * uuid: bd6a6d78-9302-42e9-8f60-ac1461e9abae
23+ * @testdox Degenerate case with no row containing 3 distinct groups of spaces
24+ */
3925 public function testDegenerateCaseWithNoRowContaining3DistinctGroupsOfSpaces (): void
4026 {
4127 $ this ->assertEquals (
@@ -48,6 +34,10 @@ public function testDegenerateCaseWithNoRowContaining3DistinctGroupsOfSpaces():
4834 );
4935 }
5036
37+ /**
38+ * uuid: af8efb49-14ed-447f-8944-4cc59ce3fd76
39+ * @testdox Smallest non-degenerate case with odd diamond side length
40+ */
5141 public function testSmallestNonDegenerateCaseWithOddDiamondSideLength (): void
5242 {
5343 $ this ->assertEquals (
@@ -62,6 +52,10 @@ public function testSmallestNonDegenerateCaseWithOddDiamondSideLength(): void
6252 );
6353 }
6454
55+ /**
56+ * uuid: e0c19a95-9888-4d05-86a0-fa81b9e70d1d
57+ * @testdox Smallest non-degenerate case with even diamond side length
58+ */
6559 public function testSmallestNonDegenerateCaseWithEvenDiamondSideLength (): void
6660 {
6761 $ this ->assertEquals (
@@ -78,6 +72,10 @@ public function testSmallestNonDegenerateCaseWithEvenDiamondSideLength(): void
7872 );
7973 }
8074
75+ /**
76+ * uuid: 82ea9aa9-4c0e-442a-b07e-40204e925944
77+ * @testdox Largest possible diamond
78+ */
8179 public function testLargestPossibleDiamond (): void
8280 {
8381 $ this ->assertEquals (
0 commit comments