Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions exercises/practice/house/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"authors": [
"tomasnorre"
],
"contributors": [
"resu-xuniL"
],
"files": {
"solution": [
"House.php"
Expand Down
39 changes: 27 additions & 12 deletions exercises/practice/house/HouseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\TestCase;

class HouseTest extends TestCase
Expand All @@ -21,7 +22,8 @@ protected function setUp(): void
/**
* uuid: 28a540ff-f765-4348-9d57-ae33f25f41f2
*/
public function testVerseOne(): void
#[TestDox('Verse one - the house that jack built')]
public function testVerseOneTheHouseThatJackBuilt(): void
{
$lyrics = ['This is the house that Jack built.'];
$this->assertEquals($lyrics, $this->house->verse(1));
Expand All @@ -30,7 +32,8 @@ public function testVerseOne(): void
/**
* uuid: ebc825ac-6e2b-4a5e-9afd-95732191c8da
*/
public function testVerseTwo(): void
#[TestDox('Verse two - the malt that lay')]
public function testVerseTwoTheMaltThatLay(): void
{
$lyrics = [
'This is the malt',
Expand All @@ -42,7 +45,8 @@ public function testVerseTwo(): void
/**
* uuid: 1ed8bb0f-edb8-4bd1-b6d4-b64754fe4a60
*/
public function testVerseThree(): void
#[TestDox('Verse three - the rat that ate')]
public function testVerseThreeTheRatThatAte(): void
{
$lyrics = [
'This is the rat',
Expand All @@ -55,7 +59,8 @@ public function testVerseThree(): void
/**
* uuid: 64b0954e-8b7d-4d14-aad0-d3f6ce297a30
*/
public function testVerseFour(): void
#[TestDox('Verse four - the cat that killed')]
public function testVerseFourTheCatThatKilled(): void
{
$lyrics = [
'This is the cat',
Expand All @@ -69,7 +74,8 @@ public function testVerseFour(): void
/**
* uuid: 1e8d56bc-fe31-424d-9084-61e6111d2c82
*/
public function testVerseFive(): void
#[TestDox('Verse five - the dog that worried')]
public function testVerseFiveTheDogThatWorried(): void
{
$lyrics = [
'This is the dog',
Expand All @@ -84,7 +90,8 @@ public function testVerseFive(): void
/**
* uuid: 6312dc6f-ab0a-40c9-8a55-8d4e582beac4
*/
public function testVerseSix(): void
#[TestDox('Verse six - the cow with the crumpled horn')]
public function testVerseSixTheCowWithTheCrumpledHorn(): void
{
$lyrics = [
'This is the cow with the crumpled horn',
Expand All @@ -100,7 +107,8 @@ public function testVerseSix(): void
/**
* uuid: 68f76d18-6e19-4692-819c-5ff6a7f92feb
*/
public function testVerseSeven(): void
#[TestDox('Verse seven - the maiden all forlorn')]
public function testVerseSevenTheMaidenAllForlorn(): void
{
$lyrics = [
'This is the maiden all forlorn',
Expand All @@ -117,7 +125,8 @@ public function testVerseSeven(): void
/**
* uuid: 73872564-2004-4071-b51d-2e4326096747
*/
public function testVerseEight(): void
#[TestDox('Verse eight - the man all tattered and torn')]
public function testVerseEightTheManAllTatteredAndTorn(): void
{
$lyrics = [
'This is the man all tattered and torn',
Expand All @@ -135,7 +144,8 @@ public function testVerseEight(): void
/**
* uuid: 0d53d743-66cb-4351-a173-82702f3338c9
*/
public function testVerseNine(): void
#[TestDox('Verse nine - the priest all shaven and shorn')]
public function testVerseNineThePriestAllShavenAndShorn(): void
{
$lyrics = [
'This is the priest all shaven and shorn',
Expand All @@ -154,7 +164,8 @@ public function testVerseNine(): void
/**
* uuid: 452f24dc-8fd7-4a82-be1a-3b4839cfeb41
*/
public function testVerseTen(): void
#[TestDox('Verse ten - the rooster that crowed in the morn')]
public function testVerseTenTheRoosterThatCrowedInTheMorn(): void
{
$lyrics = [
'This is the rooster that crowed in the morn',
Expand All @@ -174,7 +185,8 @@ public function testVerseTen(): void
/**
* uuid: 97176f20-2dd3-4646-ac72-cffced91ea26
*/
public function testVerseEleven(): void
#[TestDox('Verse eleven - the farmer sowing his corn')]
public function testVerseElevenTheFarmerSowingHisCorn(): void
{
$lyrics = [
'This is the farmer sowing his corn',
Expand All @@ -195,7 +207,8 @@ public function testVerseEleven(): void
/**
* uuid: 09824c29-6aad-4dcd-ac98-f61374a6a8b7
*/
public function testVerseTwelve(): void
#[TestDox('Verse twelve - the horse and the hound and the horn')]
public function testVerseTwelveTheHorseAndTheHoundAndTheHorn(): void
{
$lyrics = [
'This is the horse and the hound and the horn',
Expand All @@ -217,6 +230,7 @@ public function testVerseTwelve(): void
/**
* uuid: d2b980d3-7851-49e1-97ab-1524515ec200
*/
#[TestDox('Multiple verses')]
public function testMultipleVerses(): void
{
$startVerse = 4;
Expand Down Expand Up @@ -263,6 +277,7 @@ public function testMultipleVerses(): void
/**
* uuid: 0311d1d0-e085-4f23-8ae7-92406fb3e803
*/
#[TestDox('Full rhyme')]
public function testFullRhyme(): void
{
$startVerse = 1;
Expand Down
3 changes: 3 additions & 0 deletions exercises/practice/killer-sudoku-helper/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"authors": [
"tomasnorre"
],
"contributors": [
"resu-xuniL"
],
"files": {
"solution": [
"KillerSudokuHelper.php"
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/killer-sudoku-helper/KillerSudokuHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\TestCase;

class KillerSudokuHelperTest extends TestCase
Expand All @@ -21,6 +22,7 @@ protected function setUp(): void
/**
* uuid: 2aaa8f13-11b5-4054-b95c-a906e4d79fb6
*/
#[TestDox('Trivial 1-digit cages -> 1')]
public function testTrivialOneDigitCages1(): void
{
$expected = [
Expand All @@ -32,6 +34,7 @@ public function testTrivialOneDigitCages1(): void
/**
* uuid: 4645da19-9fdd-4087-a910-a6ed66823563
*/
#[TestDox('Trivial 1-digit cages -> 2')]
public function testTrivialOneDigitCages2(): void
{
$expected = [
Expand All @@ -43,6 +46,7 @@ public function testTrivialOneDigitCages2(): void
/**
* uuid: 07cfc704-f8aa-41b2-8f9a-cbefb674cb48
*/
#[TestDox('Trivial 1-digit cages -> 3')]
public function testTrivialOneDigitCages3(): void
{
$expected = [
Expand All @@ -54,6 +58,7 @@ public function testTrivialOneDigitCages3(): void
/**
* uuid: 22b8b2ba-c4fd-40b3-b1bf-40aa5e7b5f24
*/
#[TestDox('Trivial 1-digit cages -> 4')]
public function testTrivialOneDigitCages4(): void
{
$expected = [
Expand All @@ -65,6 +70,7 @@ public function testTrivialOneDigitCages4(): void
/**
* uuid: b75d16e2-ff9b-464d-8578-71f73094cea7
*/
#[TestDox('Trivial 1-digit cages -> 5')]
public function testTrivialOneDigitCages5(): void
{
$expected = [
Expand All @@ -76,6 +82,7 @@ public function testTrivialOneDigitCages5(): void
/**
* uuid: bcbf5afc-4c89-4ff6-9357-07ab4d42788f
*/
#[TestDox('Trivial 1-digit cages -> 6')]
public function testTrivialOneDigitCages6(): void
{
$expected = [
Expand All @@ -87,6 +94,7 @@ public function testTrivialOneDigitCages6(): void
/**
* uuid: 511b3bf8-186f-4e35-844f-c804d86f4a7a
*/
#[TestDox('Trivial 1-digit cages -> 7')]
public function testTrivialOneDigitCages7(): void
{
$expected = [
Expand All @@ -98,6 +106,7 @@ public function testTrivialOneDigitCages7(): void
/**
* uuid: bd09a60d-3aca-43bd-b6aa-6ccad01bedda
*/
#[TestDox('Trivial 1-digit cages -> 8')]
public function testTrivialOneDigitCages8(): void
{
$expected = [
Expand All @@ -109,6 +118,7 @@ public function testTrivialOneDigitCages8(): void
/**
* uuid: 9b539f27-44ea-4ff8-bd3d-c7e136bee677
*/
#[TestDox('Trivial 1-digit cages -> 9')]
public function testTrivialOneDigitCages9(): void
{
$expected = [
Expand All @@ -120,6 +130,7 @@ public function testTrivialOneDigitCages9(): void
/**
* uuid: 0a8b2078-b3a4-4dbd-be0d-b180f503d5c3
*/
#[TestDox('Cage with sum 45 contains all digits 1:9')]
public function testCageWithSum45ContainsAllDigits1To9(): void
{
$expected = [
Expand All @@ -131,6 +142,7 @@ public function testCageWithSum45ContainsAllDigits1To9(): void
/**
* uuid: 2635d7c9-c716-4da1-84f1-c96e03900142
*/
#[TestDox('Cage with only 1 possible combination')]
public function testCageWithOnlyOnePossibleCombination(): void
{
$expected = [
Expand All @@ -142,6 +154,7 @@ public function testCageWithOnlyOnePossibleCombination(): void
/**
* uuid: a5bde743-e3a2-4a0c-8aac-e64fceea4228
*/
#[TestDox('Cage with several combinations')]
public function testCageWithSeveralCombinations(): void
{
$expected = [
Expand All @@ -153,6 +166,7 @@ public function testCageWithSeveralCombinations(): void
/**
* uuid: dfbf411c-737d-465a-a873-ca556360c274
*/
#[TestDox('Cage with several combinations that is restricted')]
public function testCageWithSeveralCombinationsThatIsRestricted(): void
{
$expected = [
Expand Down
3 changes: 3 additions & 0 deletions exercises/practice/micro-blog/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"authors": [
"tomasnorre"
],
"contributors": [
"resu-xuniL"
],
"files": {
"solution": [
"MicroBlog.php"
Expand Down
13 changes: 13 additions & 0 deletions exercises/practice/micro-blog/MicroBlogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\TestCase;

class MicroBlogTest extends TestCase
Expand All @@ -21,6 +22,7 @@ protected function setUp(): void
/**
* uuid: b927b57f-7c98-42fd-8f33-fae091dc1efc
*/
#[TestDox('English language short')]
public function testEnglishLanguageShort(): void
{
$this->assertEquals('Hi', $this->microBlog->truncate('Hi'));
Expand All @@ -29,6 +31,7 @@ public function testEnglishLanguageShort(): void
/**
* uuid: a3fcdc5b-0ed4-4f49-80f5-b1a293eac2a0
*/
#[TestDox('English language long')]
public function testEnglishLanguageLong(): void
{
$this->assertEquals('Hello', $this->microBlog->truncate('Hello there'));
Expand All @@ -37,6 +40,7 @@ public function testEnglishLanguageLong(): void
/**
* uuid: 01910864-8e15-4007-9c7c-ac956c686e60
*/
#[TestDox('German language short (broth)')]
public function testGermanLanguageShortBroth(): void
{
$this->assertEquals('brühe', $this->microBlog->truncate('brühe'));
Expand All @@ -45,6 +49,7 @@ public function testGermanLanguageShortBroth(): void
/**
* uuid: f263e488-aefb-478f-a671-b6ba99722543
*/
#[TestDox('German language long (bear carpet → beards)')]
public function testGermanLanguageLongBearCarpetToBeards(): void
{
$this->assertEquals('Bärte', $this->microBlog->truncate('Bärteppich'));
Expand All @@ -53,6 +58,7 @@ public function testGermanLanguageLongBearCarpetToBeards(): void
/**
* uuid: 0916e8f1-41d7-4402-a110-b08aa000342c
*/
#[TestDox('Bulgarian language short (good)')]
public function testBulgarianLanguageShortGood(): void
{
$this->assertEquals('Добър', $this->microBlog->truncate('Добър'));
Expand All @@ -61,6 +67,7 @@ public function testBulgarianLanguageShortGood(): void
/**
* uuid: bed6b89c-03df-4154-98e6-a61a74f61b7d
*/
#[TestDox('Greek language short (health)')]
public function testGreekLanguageShortHealth(): void
{
$this->assertEquals('υγειά', $this->microBlog->truncate('υγειά'));
Expand All @@ -69,6 +76,7 @@ public function testGreekLanguageShortHealth(): void
/**
* uuid: 485a6a70-2edb-424d-b999-5529dbc8e002
*/
#[TestDox('Maths short')]
public function testMathShort(): void
{
$this->assertEquals('a=πr²', $this->microBlog->truncate('a=πr²'));
Expand All @@ -77,6 +85,7 @@ public function testMathShort(): void
/**
* uuid: 8b4b7b51-8f48-4fbe-964e-6e4e6438be28
*/
#[TestDox('Maths long')]
public function testMathLong(): void
{
$this->assertEquals('∅⊊ℕ⊊ℤ', $this->microBlog->truncate('∅⊊ℕ⊊ℤ⊊ℚ⊊ℝ⊊ℂ'));
Expand All @@ -85,6 +94,7 @@ public function testMathLong(): void
/**
* uuid: 71f4a192-0566-4402-a512-fe12878be523
*/
#[TestDox('English and emoji short')]
public function testEnglishAndEmojiShort(): void
{
$this->assertEquals('Fly 🛫', $this->microBlog->truncate('Fly 🛫'));
Expand All @@ -93,6 +103,7 @@ public function testEnglishAndEmojiShort(): void
/**
* uuid: 6f0f71f3-9806-4759-a844-fa182f7bc203
*/
#[TestDox('Emoji short')]
public function testEmojiShort(): void
{
$this->assertEquals('💇', $this->microBlog->truncate('💇'));
Expand All @@ -101,6 +112,7 @@ public function testEmojiShort(): void
/**
* uuid: ce71fb92-5214-46d0-a7f8-d5ba56b4cc6e
*/
#[TestDox('Emoji long')]
public function testEmojiLong(): void
{
$this->assertEquals('❄🌡🤧🤒🏥', $this->microBlog->truncate('❄🌡🤧🤒🏥🕰😀'));
Expand All @@ -109,6 +121,7 @@ public function testEmojiLong(): void
/**
* uuid: 5dee98d2-d56e-468a-a1f2-121c3f7c5a0b
*/
#[TestDox('Royal Flush?')]
public function testRoyalFlush(): void
{
$this->assertEquals('🃎🂸🃅🃋🃍', $this->microBlog->truncate('🃎🂸🃅🃋🃍🃁🃊'));
Expand Down
3 changes: 3 additions & 0 deletions exercises/practice/strain/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"authors": [
"tomasnorre"
],
"contributors": [
"resu-xuniL"
],
"files": {
"solution": [
"Strain.php"
Expand Down
Loading
Loading