77 */
88namespace OCA \Theming \Tests ;
99
10+ use OCA \Theming \ConfigLexicon ;
1011use OCA \Theming \ImageManager ;
1112use OCA \Theming \Service \BackgroundService ;
1213use OCA \Theming \ThemingDefaults ;
@@ -728,7 +729,7 @@ public function testGetScssVariables(): void {
728729 'theming-favicon-mime ' => '\'jpeg \'' ,
729730 'image-logoheader ' => "url('custom-logoheader?v=0') " ,
730731 'image-favicon ' => "url('custom-favicon?v=0') " ,
731- 'has-legal-links ' => 'false '
732+ 'has-legal-links ' => 'false ' ,
732733 ];
733734 $ this ->assertEquals ($ expected , $ this ->template ->getScssVariables ());
734735 }
@@ -798,7 +799,7 @@ public static function dataReplaceImagePath(): array {
798799 ['core ' , 'test.png ' , false ],
799800 ['core ' , 'manifest.json ' ],
800801 ['core ' , 'favicon.ico ' ],
801- ['core ' , 'favicon-touch.png ' ]
802+ ['core ' , 'favicon-touch.png ' ],
802803 ];
803804 }
804805
@@ -825,4 +826,35 @@ public function testReplaceImagePath(string $app, string $image, string|bool $re
825826 }
826827 $ this ->assertEquals ($ result , $ this ->template ->replaceImagePath ($ app , $ image ));
827828 }
829+
830+ public static function setTypesProvider (): array {
831+ return [
832+ [ConfigLexicon::BASE_URL , 'example.com ' , 'example.com ' ],
833+ [ConfigLexicon::USER_THEMING_DISABLED , 'no ' , false ],
834+ [ConfigLexicon::USER_THEMING_DISABLED , 'true ' , true ],
835+ ];
836+ }
837+
838+ #[\PHPUnit \Framework \Attributes \DataProvider('setTypesProvider ' )]
839+ public function testSetTypes (string $ setting , string $ value , mixed $ expected ): void {
840+ $ setValue = null ;
841+ $ cb = function ($ setting , $ value ) use (&$ setValue ) {
842+ if ($ setting !== ConfigLexicon::CACHE_BUSTER ) {
843+ $ setValue = $ value ;
844+ }
845+ return true ;
846+ };
847+ $ this ->appConfig
848+ ->method ('setAppValueBool ' )
849+ ->willReturnCallback ($ cb );
850+ $ this ->appConfig
851+ ->method ('setAppValueString ' )
852+ ->willReturnCallback ($ cb );
853+ $ this ->appConfig
854+ ->method ('setAppValueInt ' )
855+ ->willReturnCallback ($ cb );
856+
857+ $ this ->template ->set ($ setting , $ value );
858+ $ this ->assertEquals ($ expected , $ setValue );
859+ }
828860}
0 commit comments