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
5+ use PHPUnit \Framework \Attributes \TestDox ;
276use PHPUnit \Framework \TestCase ;
287
298class OcrNumbersTest extends TestCase
@@ -34,9 +13,9 @@ public static function setUpBeforeClass(): void
3413 }
3514
3615 /**
37- * Recognition result should be returned as a string
16+ * uuid: 5ee54e1a-b554-4bf3-a056-9a7976c3f7e8
3817 */
39-
18+ #[TestDox( ' Recognizes 0 ' )]
4019 public function testRecognizes0 (): void
4120 {
4221 $ input = [
@@ -48,6 +27,10 @@ public function testRecognizes0(): void
4827 $ this ->assertSame ('0 ' , recognize ($ input ));
4928 }
5029
30+ /**
31+ * uuid: 027ada25-17fd-4d78-aee6-35a19623639d
32+ */
33+ #[TestDox('Recognizes 1 ' )]
5134 public function testRecognizes1 (): void
5235 {
5336 $ input = [
@@ -60,9 +43,10 @@ public function testRecognizes1(): void
6043 }
6144
6245 /**
63- * Unreadable but correctly sized inputs return ?
46+ * uuid: 3cce2dbd-01d9-4f94-8fae-419a822e89bb
6447 */
65- public function testUnreadable (): void
48+ #[TestDox('Unreadable but correctly sized inputs return ? ' )]
49+ public function testUnreadableButCorrectlySizedInputsReturnQuestionmark (): void
6650 {
6751 $ input = [
6852 " " ,
@@ -74,9 +58,10 @@ public function testUnreadable(): void
7458 }
7559
7660 /**
77- * Input with a number of lines that is not a multiple of four raises an error
61+ * uuid: cb19b733-4e36-4cf9-a4a1-6e6aac808b9a
7862 */
79- public function testErrorWrongNumberOfLines (): void
63+ #[TestDox('Input with a number of lines that is not a multiple of four raises an error ' )]
64+ public function testInputWithANumberOfLinesThatIsNotAMultipleOfFourRaisesAnError (): void
8065 {
8166 $ this ->expectException (InvalidArgumentException::class);
8267
@@ -89,9 +74,10 @@ public function testErrorWrongNumberOfLines(): void
8974 }
9075
9176 /**
92- * Input with a number of columns that is not a multiple of three raises an error
77+ * uuid: 235f7bd1-991b-4587-98d4-84206eec4cc6
9378 */
94- public function testErrorWrongNumberOfColumns (): void
79+ #[TestDox('Input with a number of columns that is not a multiple of three raises an error ' )]
80+ public function testInputWithANumberOfColumnsThatIsNotAMultipleOfThreeRaisesAnError (): void
9581 {
9682 $ this ->expectException (InvalidArgumentException::class);
9783
@@ -104,6 +90,10 @@ public function testErrorWrongNumberOfColumns(): void
10490 recognize ($ input );
10591 }
10692
93+ /**
94+ * uuid: 4a841794-73c9-4da9-a779-1f9837faff66
95+ */
96+ #[TestDox('Recognizes 110101100 ' )]
10797 public function testRecognizes110101100 (): void
10898 {
10999 $ input = [
@@ -116,9 +106,10 @@ public function testRecognizes110101100(): void
116106 }
117107
118108 /**
119- * Garbled numbers in a string are replaced with ?
109+ * uuid: 70c338f9-85b1-4296-a3a8-122901cdfde8
120110 */
121- public function testGarbled (): void
111+ #[TestDox('Garbled numbers in a string are replaced with ? ' )]
112+ public function testGarbledNumbersInAStringAreReplacedWithQuestionmark (): void
122113 {
123114 $ input = [
124115 " _ _ _ " ,
@@ -129,6 +120,10 @@ public function testGarbled(): void
129120 $ this ->assertSame ('11?10?1?0 ' , recognize ($ input ));
130121 }
131122
123+ /**
124+ * uuid: ea494ff4-3610-44d7-ab7e-72fdef0e0802
125+ */
126+ #[TestDox('Recognizes 2 ' )]
132127 public function testRecognizes2 (): void
133128 {
134129 $ input = [
@@ -140,6 +135,10 @@ public function testRecognizes2(): void
140135 $ this ->assertSame ('2 ' , recognize ($ input ));
141136 }
142137
138+ /**
139+ * uuid: 1acd2c00-412b-4268-93c2-bd7ff8e05a2c
140+ */
141+ #[TestDox('Recognizes 3 ' )]
143142 public function testRecognizes3 (): void
144143 {
145144 $ input = [
@@ -151,6 +150,10 @@ public function testRecognizes3(): void
151150 $ this ->assertSame ('3 ' , recognize ($ input ));
152151 }
153152
153+ /**
154+ * uuid: eaec6a15-be17-4b6d-b895-596fae5d1329
155+ */
156+ #[TestDox('Recognizes 4 ' )]
154157 public function testRecognizes4 (): void
155158 {
156159 $ input = [
@@ -162,6 +165,10 @@ public function testRecognizes4(): void
162165 $ this ->assertSame ('4 ' , recognize ($ input ));
163166 }
164167
168+ /**
169+ * uuid: 440f397a-f046-4243-a6ca-81ab5406c56e
170+ */
171+ #[TestDox('Recognizes 5 ' )]
165172 public function testRecognizes5 (): void
166173 {
167174 $ input = [
@@ -173,6 +180,10 @@ public function testRecognizes5(): void
173180 $ this ->assertSame ('5 ' , recognize ($ input ));
174181 }
175182
183+ /**
184+ * uuid: f4c9cf6a-f1e2-4878-bfc3-9b85b657caa0
185+ */
186+ #[TestDox('Recognizes 6 ' )]
176187 public function testRecognizes6 (): void
177188 {
178189 $ input = [
@@ -184,6 +195,10 @@ public function testRecognizes6(): void
184195 $ this ->assertSame ('6 ' , recognize ($ input ));
185196 }
186197
198+ /**
199+ * uuid: e24ebf80-c611-41bb-a25a-ac2c0f232df5
200+ */
201+ #[TestDox('Recognizes 7 ' )]
187202 public function testRecognizes7 (): void
188203 {
189204 $ input = [
@@ -195,6 +210,10 @@ public function testRecognizes7(): void
195210 $ this ->assertSame ('7 ' , recognize ($ input ));
196211 }
197212
213+ /**
214+ * uuid: b79cad4f-e264-4818-9d9e-77766792e233
215+ */
216+ #[TestDox('Recognizes 8 ' )]
198217 public function testRecognizes8 (): void
199218 {
200219 $ input = [
@@ -206,6 +225,10 @@ public function testRecognizes8(): void
206225 $ this ->assertSame ('8 ' , recognize ($ input ));
207226 }
208227
228+ /**
229+ * uuid: 5efc9cfc-9227-4688-b77d-845049299e66
230+ */
231+ #[TestDox('Recognizes 9 ' )]
209232 public function testRecognizes9 (): void
210233 {
211234 $ input = [
@@ -217,6 +240,10 @@ public function testRecognizes9(): void
217240 $ this ->assertSame ('9 ' , recognize ($ input ));
218241 }
219242
243+ /**
244+ * uuid: f60cb04a-42be-494e-a535-3451c8e097a4
245+ */
246+ #[TestDox('Recognizes string of decimal numbers ' )]
220247 public function testRecognizesStringOfDecimalNumbers (): void
221248 {
222249 $ input = [
@@ -229,9 +256,10 @@ public function testRecognizesStringOfDecimalNumbers(): void
229256 }
230257
231258 /**
232- * Numbers separated by empty lines are recognized. Lines are joined by commas.
259+ * uuid: b73ecf8b-4423-4b36-860d-3710bdb8a491
233260 */
234- public function testLinesWithCommas (): void
261+ #[TestDox('Numbers separated by empty lines are recognized. Lines are joined by commas. ' )]
262+ public function testNumbersSeparatedByEmptyLinesAreRecognizedLinesAreJoinedByCommas (): void
235263 {
236264 $ input = [
237265 " _ _ " ,
0 commit comments