[master] Fix tests for master branch
This commit is contained in:
@@ -33,13 +33,15 @@ class phpbb_unit_modules_birthday_list_test extends \board3\portal\tests\testfra
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
global $auth, $phpbb_dispatcher;
|
||||
global $auth, $phpbb_dispatcher, $phpbb_root_path;
|
||||
|
||||
parent::setUp();
|
||||
|
||||
$this->template = new \board3\portal\tests\mock\template($this);
|
||||
$this->config = new \phpbb\config\config(array());
|
||||
$this->user = new \phpbb\user('\phpbb\datetime');
|
||||
$this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php');
|
||||
$this->language = new \phpbb\language\language($this->language_file_loader);
|
||||
$this->user = new \phpbb\user($this->language, '\phpbb\datetime');
|
||||
$this->user->timezone = new \DateTimeZone('UTC');
|
||||
$this->user->add_lang('common');
|
||||
$this->birthday_list = new \board3\portal\modules\birthday_list($this->config, $this->template, $this->new_dbal(), $this->user);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
namespace board3\portal\modules;
|
||||
|
||||
require_once dirname(__FILE__) . '/../../mock/check_form_key.php';
|
||||
require_once dirname(__FILE__) . '/../../../../../../includes/functions_compatibility.php';
|
||||
|
||||
class phpbb_unit_modules_calendar_test extends \board3\portal\tests\testframework\database_test_case
|
||||
{
|
||||
@@ -63,7 +64,9 @@ class phpbb_unit_modules_calendar_test extends \board3\portal\tests\testframewor
|
||||
$controller_helper->add_route('board3_portal_controller', 'portal');
|
||||
$modules_helper = new \board3\portal\includes\modules_helper(new \phpbb\auth\auth(), new \phpbb\config\config(array()), $controller_helper, new \phpbb_mock_request());
|
||||
$request = $this->request = new \phpbb_mock_request();
|
||||
$user = new \phpbb\user('\phpbb\datetime');
|
||||
$this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php');
|
||||
$this->language = new \phpbb\language\language($this->language_file_loader);
|
||||
$user = new \phpbb\user($this->language, '\phpbb\datetime');
|
||||
$user->timezone = new \DateTimeZone('UTC');
|
||||
$user->add_lang('common');
|
||||
$log = $this->getMockBuilder('\phpbb\log')
|
||||
|
||||
@@ -18,4 +18,18 @@
|
||||
<value></value>
|
||||
</row>
|
||||
</table>
|
||||
<table name="phpbb_styles">
|
||||
<column>style_id</column>
|
||||
<column>style_path</column>
|
||||
<column>style_parent_id</column>
|
||||
<column>bbcode_bitfield</column>
|
||||
<column>style_parent_tree</column>
|
||||
<row>
|
||||
<value>1</value>
|
||||
<value>prosilver</value>
|
||||
<value>0</value>
|
||||
<value>1Ng=</value>
|
||||
<value></value>
|
||||
</row>
|
||||
</table>
|
||||
</dataset>
|
||||
|
||||
@@ -38,13 +38,15 @@ class phpbb_unit_modules_welcome_test extends \board3\portal\tests\testframework
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
global $cache, $phpbb_root_path, $phpEx, $phpbb_dispatcher, $request;
|
||||
global $cache, $phpbb_root_path, $phpEx, $phpbb_dispatcher, $request, $config, $phpbb_container;
|
||||
|
||||
$this->config = new \phpbb\config\config(array());
|
||||
$config = $this->config = new \phpbb\config\config(array());
|
||||
$this->request = new \phpbb_mock_request();
|
||||
$request = $this->request;
|
||||
$this->template = new \board3\portal\tests\mock\template($this);
|
||||
$this->user = new \phpbb\user('\phpbb\datetime');
|
||||
$this->language_file_loader = new \phpbb\language\language_file_loader($phpbb_root_path, 'php');
|
||||
$this->language = new \phpbb\language\language($this->language_file_loader);
|
||||
$this->user = new \phpbb\user($this->language, '\phpbb\datetime');
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put', 'sql_load'));
|
||||
$cache->expects($this->any())
|
||||
->method('destroy')
|
||||
@@ -70,6 +72,34 @@ class phpbb_unit_modules_welcome_test extends \board3\portal\tests\testframework
|
||||
->method('trigger_event')
|
||||
->with($this->anything())
|
||||
->will($this->returnArgument(1));
|
||||
$phpbb_container = new \phpbb_mock_container_builder();
|
||||
$s9e_factory = new \phpbb\textformatter\s9e\factory(
|
||||
new \phpbb\textformatter\data_access($this->db, BBCODES_TABLE, SMILIES_TABLE, STYLES_TABLE, WORDS_TABLE, $phpbb_root_path . 'styles/'),
|
||||
new \phpbb\cache\driver\dummy(),
|
||||
$phpbb_dispatcher,
|
||||
$phpbb_root_path . 'cache',
|
||||
'_text_formatter_parser',
|
||||
'_text_formatter_renderer'
|
||||
);
|
||||
$phpbb_container->set(
|
||||
'text_formatter.parser',
|
||||
new \phpbb\textformatter\s9e\parser(
|
||||
new \phpbb\cache\driver\dummy(),
|
||||
'_text_formatter_parser',
|
||||
$s9e_factory,
|
||||
$phpbb_dispatcher
|
||||
)
|
||||
);
|
||||
$phpbb_container->set(
|
||||
'text_formatter.renderer',
|
||||
new \phpbb\textformatter\s9e\renderer(
|
||||
new \phpbb\cache\driver\dummy(),
|
||||
$phpbb_root_path . 'cache',
|
||||
'_text_formatter_renderer',
|
||||
$s9e_factory,
|
||||
$phpbb_dispatcher
|
||||
)
|
||||
);
|
||||
|
||||
$this->welcome = new \board3\portal\modules\welcome($this->config, $this->request, $this->template, $this->user, $phpbb_root_path, $phpEx);
|
||||
\set_config('foobar', 0, false, $this->config);
|
||||
|
||||
Reference in New Issue
Block a user