Skip to content

Commit 08d7acc

Browse files
authored
Add missing TestDox on exercices (#1023)
[no important files changed]
1 parent 93f1da9 commit 08d7acc

10 files changed

Lines changed: 103 additions & 12 deletions

File tree

β€Žexercises/practice/house/.meta/config.jsonβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"authors": [
33
"tomasnorre"
44
],
5+
"contributors": [
6+
"resu-xuniL"
7+
],
58
"files": {
69
"solution": [
710
"House.php"

β€Žexercises/practice/house/HouseTest.phpβ€Ž

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
declare(strict_types=1);
44

5+
use PHPUnit\Framework\Attributes\TestDox;
56
use PHPUnit\Framework\TestCase;
67

78
class HouseTest extends TestCase
@@ -21,7 +22,8 @@ protected function setUp(): void
2122
/**
2223
* uuid: 28a540ff-f765-4348-9d57-ae33f25f41f2
2324
*/
24-
public function testVerseOne(): void
25+
#[TestDox('Verse one - the house that jack built')]
26+
public function testVerseOneTheHouseThatJackBuilt(): void
2527
{
2628
$lyrics = ['This is the house that Jack built.'];
2729
$this->assertEquals($lyrics, $this->house->verse(1));
@@ -30,7 +32,8 @@ public function testVerseOne(): void
3032
/**
3133
* uuid: ebc825ac-6e2b-4a5e-9afd-95732191c8da
3234
*/
33-
public function testVerseTwo(): void
35+
#[TestDox('Verse two - the malt that lay')]
36+
public function testVerseTwoTheMaltThatLay(): void
3437
{
3538
$lyrics = [
3639
'This is the malt',
@@ -42,7 +45,8 @@ public function testVerseTwo(): void
4245
/**
4346
* uuid: 1ed8bb0f-edb8-4bd1-b6d4-b64754fe4a60
4447
*/
45-
public function testVerseThree(): void
48+
#[TestDox('Verse three - the rat that ate')]
49+
public function testVerseThreeTheRatThatAte(): void
4650
{
4751
$lyrics = [
4852
'This is the rat',
@@ -55,7 +59,8 @@ public function testVerseThree(): void
5559
/**
5660
* uuid: 64b0954e-8b7d-4d14-aad0-d3f6ce297a30
5761
*/
58-
public function testVerseFour(): void
62+
#[TestDox('Verse four - the cat that killed')]
63+
public function testVerseFourTheCatThatKilled(): void
5964
{
6065
$lyrics = [
6166
'This is the cat',
@@ -69,7 +74,8 @@ public function testVerseFour(): void
6974
/**
7075
* uuid: 1e8d56bc-fe31-424d-9084-61e6111d2c82
7176
*/
72-
public function testVerseFive(): void
77+
#[TestDox('Verse five - the dog that worried')]
78+
public function testVerseFiveTheDogThatWorried(): void
7379
{
7480
$lyrics = [
7581
'This is the dog',
@@ -84,7 +90,8 @@ public function testVerseFive(): void
8490
/**
8591
* uuid: 6312dc6f-ab0a-40c9-8a55-8d4e582beac4
8692
*/
87-
public function testVerseSix(): void
93+
#[TestDox('Verse six - the cow with the crumpled horn')]
94+
public function testVerseSixTheCowWithTheCrumpledHorn(): void
8895
{
8996
$lyrics = [
9097
'This is the cow with the crumpled horn',
@@ -100,7 +107,8 @@ public function testVerseSix(): void
100107
/**
101108
* uuid: 68f76d18-6e19-4692-819c-5ff6a7f92feb
102109
*/
103-
public function testVerseSeven(): void
110+
#[TestDox('Verse seven - the maiden all forlorn')]
111+
public function testVerseSevenTheMaidenAllForlorn(): void
104112
{
105113
$lyrics = [
106114
'This is the maiden all forlorn',
@@ -117,7 +125,8 @@ public function testVerseSeven(): void
117125
/**
118126
* uuid: 73872564-2004-4071-b51d-2e4326096747
119127
*/
120-
public function testVerseEight(): void
128+
#[TestDox('Verse eight - the man all tattered and torn')]
129+
public function testVerseEightTheManAllTatteredAndTorn(): void
121130
{
122131
$lyrics = [
123132
'This is the man all tattered and torn',
@@ -135,7 +144,8 @@ public function testVerseEight(): void
135144
/**
136145
* uuid: 0d53d743-66cb-4351-a173-82702f3338c9
137146
*/
138-
public function testVerseNine(): void
147+
#[TestDox('Verse nine - the priest all shaven and shorn')]
148+
public function testVerseNineThePriestAllShavenAndShorn(): void
139149
{
140150
$lyrics = [
141151
'This is the priest all shaven and shorn',
@@ -154,7 +164,8 @@ public function testVerseNine(): void
154164
/**
155165
* uuid: 452f24dc-8fd7-4a82-be1a-3b4839cfeb41
156166
*/
157-
public function testVerseTen(): void
167+
#[TestDox('Verse ten - the rooster that crowed in the morn')]
168+
public function testVerseTenTheRoosterThatCrowedInTheMorn(): void
158169
{
159170
$lyrics = [
160171
'This is the rooster that crowed in the morn',
@@ -174,7 +185,8 @@ public function testVerseTen(): void
174185
/**
175186
* uuid: 97176f20-2dd3-4646-ac72-cffced91ea26
176187
*/
177-
public function testVerseEleven(): void
188+
#[TestDox('Verse eleven - the farmer sowing his corn')]
189+
public function testVerseElevenTheFarmerSowingHisCorn(): void
178190
{
179191
$lyrics = [
180192
'This is the farmer sowing his corn',
@@ -195,7 +207,8 @@ public function testVerseEleven(): void
195207
/**
196208
* uuid: 09824c29-6aad-4dcd-ac98-f61374a6a8b7
197209
*/
198-
public function testVerseTwelve(): void
210+
#[TestDox('Verse twelve - the horse and the hound and the horn')]
211+
public function testVerseTwelveTheHorseAndTheHoundAndTheHorn(): void
199212
{
200213
$lyrics = [
201214
'This is the horse and the hound and the horn',
@@ -217,6 +230,7 @@ public function testVerseTwelve(): void
217230
/**
218231
* uuid: d2b980d3-7851-49e1-97ab-1524515ec200
219232
*/
233+
#[TestDox('Multiple verses')]
220234
public function testMultipleVerses(): void
221235
{
222236
$startVerse = 4;
@@ -263,6 +277,7 @@ public function testMultipleVerses(): void
263277
/**
264278
* uuid: 0311d1d0-e085-4f23-8ae7-92406fb3e803
265279
*/
280+
#[TestDox('Full rhyme')]
266281
public function testFullRhyme(): void
267282
{
268283
$startVerse = 1;

β€Žexercises/practice/killer-sudoku-helper/.meta/config.jsonβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"authors": [
33
"tomasnorre"
44
],
5+
"contributors": [
6+
"resu-xuniL"
7+
],
58
"files": {
69
"solution": [
710
"KillerSudokuHelper.php"

β€Žexercises/practice/killer-sudoku-helper/KillerSudokuHelperTest.phpβ€Ž

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
declare(strict_types=1);
44

5+
use PHPUnit\Framework\Attributes\TestDox;
56
use PHPUnit\Framework\TestCase;
67

78
class KillerSudokuHelperTest extends TestCase
@@ -21,6 +22,7 @@ protected function setUp(): void
2122
/**
2223
* uuid: 2aaa8f13-11b5-4054-b95c-a906e4d79fb6
2324
*/
25+
#[TestDox('Trivial 1-digit cages -> 1')]
2426
public function testTrivialOneDigitCages1(): void
2527
{
2628
$expected = [
@@ -32,6 +34,7 @@ public function testTrivialOneDigitCages1(): void
3234
/**
3335
* uuid: 4645da19-9fdd-4087-a910-a6ed66823563
3436
*/
37+
#[TestDox('Trivial 1-digit cages -> 2')]
3538
public function testTrivialOneDigitCages2(): void
3639
{
3740
$expected = [
@@ -43,6 +46,7 @@ public function testTrivialOneDigitCages2(): void
4346
/**
4447
* uuid: 07cfc704-f8aa-41b2-8f9a-cbefb674cb48
4548
*/
49+
#[TestDox('Trivial 1-digit cages -> 3')]
4650
public function testTrivialOneDigitCages3(): void
4751
{
4852
$expected = [
@@ -54,6 +58,7 @@ public function testTrivialOneDigitCages3(): void
5458
/**
5559
* uuid: 22b8b2ba-c4fd-40b3-b1bf-40aa5e7b5f24
5660
*/
61+
#[TestDox('Trivial 1-digit cages -> 4')]
5762
public function testTrivialOneDigitCages4(): void
5863
{
5964
$expected = [
@@ -65,6 +70,7 @@ public function testTrivialOneDigitCages4(): void
6570
/**
6671
* uuid: b75d16e2-ff9b-464d-8578-71f73094cea7
6772
*/
73+
#[TestDox('Trivial 1-digit cages -> 5')]
6874
public function testTrivialOneDigitCages5(): void
6975
{
7076
$expected = [
@@ -76,6 +82,7 @@ public function testTrivialOneDigitCages5(): void
7682
/**
7783
* uuid: bcbf5afc-4c89-4ff6-9357-07ab4d42788f
7884
*/
85+
#[TestDox('Trivial 1-digit cages -> 6')]
7986
public function testTrivialOneDigitCages6(): void
8087
{
8188
$expected = [
@@ -87,6 +94,7 @@ public function testTrivialOneDigitCages6(): void
8794
/**
8895
* uuid: 511b3bf8-186f-4e35-844f-c804d86f4a7a
8996
*/
97+
#[TestDox('Trivial 1-digit cages -> 7')]
9098
public function testTrivialOneDigitCages7(): void
9199
{
92100
$expected = [
@@ -98,6 +106,7 @@ public function testTrivialOneDigitCages7(): void
98106
/**
99107
* uuid: bd09a60d-3aca-43bd-b6aa-6ccad01bedda
100108
*/
109+
#[TestDox('Trivial 1-digit cages -> 8')]
101110
public function testTrivialOneDigitCages8(): void
102111
{
103112
$expected = [
@@ -109,6 +118,7 @@ public function testTrivialOneDigitCages8(): void
109118
/**
110119
* uuid: 9b539f27-44ea-4ff8-bd3d-c7e136bee677
111120
*/
121+
#[TestDox('Trivial 1-digit cages -> 9')]
112122
public function testTrivialOneDigitCages9(): void
113123
{
114124
$expected = [
@@ -120,6 +130,7 @@ public function testTrivialOneDigitCages9(): void
120130
/**
121131
* uuid: 0a8b2078-b3a4-4dbd-be0d-b180f503d5c3
122132
*/
133+
#[TestDox('Cage with sum 45 contains all digits 1:9')]
123134
public function testCageWithSum45ContainsAllDigits1To9(): void
124135
{
125136
$expected = [
@@ -131,6 +142,7 @@ public function testCageWithSum45ContainsAllDigits1To9(): void
131142
/**
132143
* uuid: 2635d7c9-c716-4da1-84f1-c96e03900142
133144
*/
145+
#[TestDox('Cage with only 1 possible combination')]
134146
public function testCageWithOnlyOnePossibleCombination(): void
135147
{
136148
$expected = [
@@ -142,6 +154,7 @@ public function testCageWithOnlyOnePossibleCombination(): void
142154
/**
143155
* uuid: a5bde743-e3a2-4a0c-8aac-e64fceea4228
144156
*/
157+
#[TestDox('Cage with several combinations')]
145158
public function testCageWithSeveralCombinations(): void
146159
{
147160
$expected = [
@@ -153,6 +166,7 @@ public function testCageWithSeveralCombinations(): void
153166
/**
154167
* uuid: dfbf411c-737d-465a-a873-ca556360c274
155168
*/
169+
#[TestDox('Cage with several combinations that is restricted')]
156170
public function testCageWithSeveralCombinationsThatIsRestricted(): void
157171
{
158172
$expected = [

β€Žexercises/practice/micro-blog/.meta/config.jsonβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"authors": [
33
"tomasnorre"
44
],
5+
"contributors": [
6+
"resu-xuniL"
7+
],
58
"files": {
69
"solution": [
710
"MicroBlog.php"

β€Žexercises/practice/micro-blog/MicroBlogTest.phpβ€Ž

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
declare(strict_types=1);
44

5+
use PHPUnit\Framework\Attributes\TestDox;
56
use PHPUnit\Framework\TestCase;
67

78
class MicroBlogTest extends TestCase
@@ -21,6 +22,7 @@ protected function setUp(): void
2122
/**
2223
* uuid: b927b57f-7c98-42fd-8f33-fae091dc1efc
2324
*/
25+
#[TestDox('English language short')]
2426
public function testEnglishLanguageShort(): void
2527
{
2628
$this->assertEquals('Hi', $this->microBlog->truncate('Hi'));
@@ -29,6 +31,7 @@ public function testEnglishLanguageShort(): void
2931
/**
3032
* uuid: a3fcdc5b-0ed4-4f49-80f5-b1a293eac2a0
3133
*/
34+
#[TestDox('English language long')]
3235
public function testEnglishLanguageLong(): void
3336
{
3437
$this->assertEquals('Hello', $this->microBlog->truncate('Hello there'));
@@ -37,6 +40,7 @@ public function testEnglishLanguageLong(): void
3740
/**
3841
* uuid: 01910864-8e15-4007-9c7c-ac956c686e60
3942
*/
43+
#[TestDox('German language short (broth)')]
4044
public function testGermanLanguageShortBroth(): void
4145
{
4246
$this->assertEquals('brΓΌhe', $this->microBlog->truncate('brΓΌhe'));
@@ -45,6 +49,7 @@ public function testGermanLanguageShortBroth(): void
4549
/**
4650
* uuid: f263e488-aefb-478f-a671-b6ba99722543
4751
*/
52+
#[TestDox('German language long (bear carpet β†’ beards)')]
4853
public function testGermanLanguageLongBearCarpetToBeards(): void
4954
{
5055
$this->assertEquals('BΓ€rte', $this->microBlog->truncate('BΓ€rteppich'));
@@ -53,6 +58,7 @@ public function testGermanLanguageLongBearCarpetToBeards(): void
5358
/**
5459
* uuid: 0916e8f1-41d7-4402-a110-b08aa000342c
5560
*/
61+
#[TestDox('Bulgarian language short (good)')]
5662
public function testBulgarianLanguageShortGood(): void
5763
{
5864
$this->assertEquals('Π”ΠΎΠ±ΡŠΡ€', $this->microBlog->truncate('Π”ΠΎΠ±ΡŠΡ€'));
@@ -61,6 +67,7 @@ public function testBulgarianLanguageShortGood(): void
6167
/**
6268
* uuid: bed6b89c-03df-4154-98e6-a61a74f61b7d
6369
*/
70+
#[TestDox('Greek language short (health)')]
6471
public function testGreekLanguageShortHealth(): void
6572
{
6673
$this->assertEquals('υγΡιά', $this->microBlog->truncate('υγΡιά'));
@@ -69,6 +76,7 @@ public function testGreekLanguageShortHealth(): void
6976
/**
7077
* uuid: 485a6a70-2edb-424d-b999-5529dbc8e002
7178
*/
79+
#[TestDox('Maths short')]
7280
public function testMathShort(): void
7381
{
7482
$this->assertEquals('a=Ο€rΒ²', $this->microBlog->truncate('a=Ο€rΒ²'));
@@ -77,6 +85,7 @@ public function testMathShort(): void
7785
/**
7886
* uuid: 8b4b7b51-8f48-4fbe-964e-6e4e6438be28
7987
*/
88+
#[TestDox('Maths long')]
8089
public function testMathLong(): void
8190
{
8291
$this->assertEquals('βˆ…βŠŠβ„•βŠŠβ„€', $this->microBlog->truncate('βˆ…βŠŠβ„•βŠŠβ„€βŠŠβ„šβŠŠβ„βŠŠβ„‚'));
@@ -85,6 +94,7 @@ public function testMathLong(): void
8594
/**
8695
* uuid: 71f4a192-0566-4402-a512-fe12878be523
8796
*/
97+
#[TestDox('English and emoji short')]
8898
public function testEnglishAndEmojiShort(): void
8999
{
90100
$this->assertEquals('Fly πŸ›«', $this->microBlog->truncate('Fly πŸ›«'));
@@ -93,6 +103,7 @@ public function testEnglishAndEmojiShort(): void
93103
/**
94104
* uuid: 6f0f71f3-9806-4759-a844-fa182f7bc203
95105
*/
106+
#[TestDox('Emoji short')]
96107
public function testEmojiShort(): void
97108
{
98109
$this->assertEquals('πŸ’‡', $this->microBlog->truncate('πŸ’‡'));
@@ -101,6 +112,7 @@ public function testEmojiShort(): void
101112
/**
102113
* uuid: ce71fb92-5214-46d0-a7f8-d5ba56b4cc6e
103114
*/
115+
#[TestDox('Emoji long')]
104116
public function testEmojiLong(): void
105117
{
106118
$this->assertEquals('β„πŸŒ‘πŸ€§πŸ€’πŸ₯', $this->microBlog->truncate('β„πŸŒ‘πŸ€§πŸ€’πŸ₯πŸ•°πŸ˜€'));
@@ -109,6 +121,7 @@ public function testEmojiLong(): void
109121
/**
110122
* uuid: 5dee98d2-d56e-468a-a1f2-121c3f7c5a0b
111123
*/
124+
#[TestDox('Royal Flush?')]
112125
public function testRoyalFlush(): void
113126
{
114127
$this->assertEquals('πŸƒŽπŸ‚ΈπŸƒ…πŸƒ‹πŸƒ', $this->microBlog->truncate('πŸƒŽπŸ‚ΈπŸƒ…πŸƒ‹πŸƒπŸƒπŸƒŠ'));

β€Žexercises/practice/strain/.meta/config.jsonβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"authors": [
33
"tomasnorre"
44
],
5+
"contributors": [
6+
"resu-xuniL"
7+
],
58
"files": {
69
"solution": [
710
"Strain.php"

0 commit comments

Comments
Β (0)