mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-11-03 02:27:21 +09:00
Co-authored-by: FOSSBilling Bot <fossbilling-bot> Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
32 lines
943 B
PHP
32 lines
943 B
PHP
<?php
|
|
|
|
/**
|
|
* Copyright 2022-2026 FOSSBilling
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*
|
|
* @copyright FOSSBilling (https://www.fossbilling.org)
|
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
use FOSSBilling\Twig\Enum\AppArea;
|
|
use FOSSBilling\Twig\TwigLoader;
|
|
use Twig\Error\LoaderError;
|
|
|
|
test('templates', function (): void {
|
|
$loader = new TwigLoader(AppArea::CLIENT, PATH_THEMES . DIRECTORY_SEPARATOR . 'huraga');
|
|
$test = $loader->getSourceContext('mod_page_login.html.twig');
|
|
$test2 = $loader->getSourceContext('error.html.twig');
|
|
|
|
expect($test)->toBeObject();
|
|
expect($test2)->toBeObject();
|
|
});
|
|
|
|
test('exception', function (): void {
|
|
$loader = new TwigLoader(AppArea::CLIENT, PATH_THEMES . DIRECTORY_SEPARATOR . 'huraga');
|
|
|
|
expect(fn (): Twig\Source => $loader->getSourceContext('mod_non_existing_settings.html.twig'))
|
|
->toThrow(LoaderError::class);
|
|
});
|