@@ -44,6 +44,22 @@ public function testThemes(): void
4444 }
4545 }
4646
47+ /**
48+ * Test that all themes appear in the documentation (docs/themes.md)
49+ */
50+ public function testThemesInDocumentation (): void
51+ {
52+ $ themes = include "src/themes.php " ;
53+ $ docContent = file_get_contents ("docs/themes.md " );
54+ foreach (array_keys ($ themes ) as $ theme ) {
55+ $ this ->assertStringContainsString (
56+ "` $ theme` " ,
57+ $ docContent ,
58+ "The theme ' $ theme' is missing from the documentation (docs/themes.md). "
59+ );
60+ }
61+ }
62+
4763 /**
4864 * Test fallback to default theme
4965 */
@@ -74,7 +90,7 @@ public function testThemesHaveValidParameters(): void
7490 $ this ->assertEquals (
7591 array_diff_key ($ colors , $ this ->defaultTheme ),
7692 [],
77- "The theme ' $ theme' contains invalid parameters. " ,
93+ "The theme ' $ theme' contains invalid parameters. "
7894 );
7995 # check that no parameters are missing and all values are valid
8096 foreach (array_keys ($ this ->defaultTheme ) as $ param ) {
@@ -85,21 +101,21 @@ public function testThemesHaveValidParameters(): void
85101 $ this ->assertMatchesRegularExpression (
86102 $ backgroundRegex ,
87103 $ colors [$ param ],
88- "The parameter ' $ param' of ' $ theme' is not a valid background value. " ,
104+ "The parameter ' $ param' of ' $ theme' is not a valid background value. "
89105 );
90106 continue ;
91107 }
92108 // check that the key is a valid hex color
93109 $ this ->assertMatchesRegularExpression (
94110 $ hexRegex ,
95111 strtoupper ($ colors [$ param ]),
96- "The parameter ' $ param' of ' $ theme' is not a valid hex color. " ,
112+ "The parameter ' $ param' of ' $ theme' is not a valid hex color. "
97113 );
98114 // check that the key is a valid hex color in uppercase
99115 $ this ->assertMatchesRegularExpression (
100116 $ hexRegex ,
101117 $ colors [$ param ],
102- "The parameter ' $ param' of ' $ theme' should not contain lowercase letters. " ,
118+ "The parameter ' $ param' of ' $ theme' should not contain lowercase letters. "
103119 );
104120 }
105121 }
@@ -251,7 +267,7 @@ public function testAllThemeNamesNormalized(): void
251267 $ this ->assertEquals (
252268 $ theme ,
253269 $ normalized ,
254- "Theme name ' $ theme' is not normalized. It should contain only lowercase letters, numbers, and dashes. Consider renaming it to ' $ normalized'. " ,
270+ "Theme name ' $ theme' is not normalized. It should contain only lowercase letters, numbers, and dashes. Consider renaming it to ' $ normalized'. "
255271 );
256272 }
257273 }
0 commit comments