]> BookStack Code Mirror - bookstack/commitdiff
Testing: Added favicon cleanup
authorDan Brown <redacted>
Tue, 3 Oct 2023 13:50:54 +0000 (14:50 +0100)
committerDan Brown <redacted>
Tue, 3 Oct 2023 13:50:54 +0000 (14:50 +0100)
Was leaving a changed favicon leaving other test to fail.

tests/Helpers/FileProvider.php
tests/PwaManifestTest.php

index 99ee11efbad8b355e136a794c9b2215b8b594e18..442e036ff245e4dda122b4d7a4bbbaf033293fd2 100644 (file)
@@ -159,4 +159,12 @@ class FileProvider
             $fileService->deleteFile($file);
         }
     }
+
+    /**
+     * Reset the application favicon image in the public path.
+     */
+    public function resetAppFavicon(): void
+    {
+        file_put_contents(public_path('favicon.ico'), file_get_contents(public_path('icon.ico')));
+    }
 }
index b8317321dc4afd72b0c11a680d4d9d80d52b4f44..ad94790481cfa1ff80b3b03c7ee6c54e1d04a863 100644 (file)
@@ -32,6 +32,8 @@ class PwaManifestTest extends TestCase
 
     public function test_manifest_uses_configured_icons_if_existing()
     {
+        $this->beforeApplicationDestroyed(fn() => $this->files->resetAppFavicon());
+
         $resp = $this->get('/manifest.json');
         $resp->assertJson([
             'icons' => [[
Morty Proxy This is a proxified and sanitized view of the page, visit original site.