1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-09 02:06:32 +02:00

[ticket/17519] Add unit tests for task wrapper

PHPBB-17519
This commit is contained in:
Marc Alexander
2025-06-12 20:59:22 +02:00
parent 6947dc8c92
commit 5deeea025f
5 changed files with 151 additions and 5 deletions

View File

@@ -1,4 +1,7 @@
<?php
use phpbb\template\twig\twig;
/**
*
* This file is part of the phpBB Forum Software package.
@@ -14,6 +17,7 @@
class phpbb_template_template_test_case extends phpbb_test_case
{
protected $lang;
/** @var twig */
protected $template;
protected $template_path;
protected $user;
@@ -69,7 +73,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
return $defaults;
}
protected function setup_engine(array $new_config = array())
protected function setup_engine(array $new_config = array(), string $template_path = '')
{
global $phpbb_root_path, $phpEx;
@@ -92,7 +96,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
$phpEx
);
$this->template_path = $this->test_path . '/templates';
$this->template_path = $template_path ?: $this->test_path . '/templates';
$container = new phpbb_mock_container_builder();
$cache_path = $phpbb_root_path . 'cache/twig';