1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 10:44:20 +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

@@ -15,7 +15,7 @@ require_once __DIR__ . '/template_test_case.php';
class phpbb_template_extension_test extends phpbb_template_template_test_case
{
protected function setup_engine(array $new_config = array())
protected function setup_engine(array $new_config = array(), string $template_path = '')
{
global $config, $phpbb_container, $phpbb_dispatcher, $phpbb_root_path, $phpEx;

View File

@@ -21,7 +21,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
/** @var string */
protected $parent_template_path;
protected function setup_engine(array $new_config = array())
protected function setup_engine(array $new_config = array(), string $template_path = '')
{
global $phpbb_root_path, $phpEx, $user;

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';

View File

@@ -15,7 +15,7 @@ require_once __DIR__ . '/template_test_case.php';
class phpbb_template_template_test_case_with_tree extends phpbb_template_template_test_case
{
protected function setup_engine(array $new_config = array())
protected function setup_engine(array $new_config = array(), string $template_path = '')
{
global $phpbb_root_path, $phpEx, $user;