mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-16 21:17:45 +02:00
feat(plugins): add html field type + CodeEditor component + rework html head generation
update php and js packages to latest
This commit is contained in:
parent
b869acb3a9
commit
8cf9c6dc83
227 changed files with 2991 additions and 2988 deletions
|
|
@ -6,6 +6,7 @@ namespace Tests\Modules\Plugins;
|
|||
|
||||
use App\Entities\Episode;
|
||||
use App\Entities\Podcast;
|
||||
use App\Libraries\HtmlHead;
|
||||
use App\Libraries\RssFeed;
|
||||
use CodeIgniter\Test\CIUnitTestCase;
|
||||
use CodeIgniter\Test\DatabaseTestTrait;
|
||||
|
|
@ -111,11 +112,21 @@ final class PluginsTest extends CIUnitTestCase
|
|||
self::$plugins->runHook('rssAfterItem', [$episode, $item]);
|
||||
$this->assertFalse(empty($item->efoo));
|
||||
|
||||
ob_start();
|
||||
self::$plugins->runHook('siteHead', []);
|
||||
$result = ob_get_contents();
|
||||
ob_end_clean(); //Discard output buffer
|
||||
$this->assertEquals('hello', $result);
|
||||
$head = new HtmlHead();
|
||||
self::$plugins->runHook('siteHead', [$head]);
|
||||
|
||||
$this->assertEquals(
|
||||
(string) $head,
|
||||
'<head> <title >foo</title> <meta charset="UTF-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <link rel="icon" type="image/x-icon" href="http://localhost:8080/favicon.ico"/> <link rel="apple-touch-icon" href="http://localhost:8080/icon-180.png"/> <link rel="manifest" href="/manifest.webmanifest"/> <meta name="theme-color" content="#009486"/> <link rel="stylesheet" type="text/css" href="/themes/colors"/> <title >foo</title> <script>
|
||||
// Check that service workers are supported
|
||||
if (\'serviceWorker\' in navigator) {
|
||||
// Use the window load event to keep the page load performant
|
||||
window.addEventListener(\'load\', () => {
|
||||
navigator.serviceWorker.register(\'/sw.js\');
|
||||
});
|
||||
}
|
||||
</script></head>'
|
||||
);
|
||||
}
|
||||
|
||||
public function testRunHooksInactive(): void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue