diff --git a/src/Compat/Theme.php b/src/Compat/Theme.php index c16f47f..51ed769 100644 --- a/src/Compat/Theme.php +++ b/src/Compat/Theme.php @@ -23,6 +23,7 @@ use function loadJavaScriptFile; use function loadEssentialThemeData; use function loadTemplate; +use function loadSubTemplate; class Theme { @@ -87,4 +88,9 @@ public static function loadTemplate(string $template): void { loadTemplate($template); } + + public static function loadSubTemplate(string $sub_template_name, bool $fatal = false): void + { + loadSubTemplate($sub_template_name, $fatal); + } } diff --git a/tests/Pest.php b/tests/Pest.php index 7d3c1d9..7873706 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -321,6 +321,12 @@ function loadTemplate(string $name): void } } +if (! function_exists('loadSubTemplate')) { + function loadSubTemplate(string $sub_template_name, bool $fatal = false): void + { + } +} + if (! function_exists('JavaScriptEscape')) { function JavaScriptEscape(...$params): string { diff --git a/tests/Unit/ThemeTest.php b/tests/Unit/ThemeTest.php index 9e48f84..03ef56e 100644 --- a/tests/Unit/ThemeTest.php +++ b/tests/Unit/ThemeTest.php @@ -100,3 +100,14 @@ expect($result)->toBeSuccess(); }); + +test('loadSubTemplate method', function () { + try { + $this->theme::loadSubTemplate('Test'); + $result = 'success'; + } catch (Exception $e) { + $result = $e->getMessage(); + } + + expect($result)->toBeSuccess(); +});