[ticket/690] Make tests compatible with latest version of phpunit & phpBB

B3P-690
This commit is contained in:
Marc Alexander
2021-08-27 22:20:51 +02:00
parent 7ee3bd1727
commit abf8a7bfcf
16 changed files with 120 additions and 43 deletions

View File

@@ -45,7 +45,9 @@ class phpbb_unit_modules_birthday_list_test extends \board3\portal\tests\testfra
$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);
$auth = $this->getMock('\phpbb\auth\auth', array('acl_get'));
$auth = $this->getMockBuilder('\phpbb\auth\auth')
->setMethods(['acl_get'])
->getMock();
$auth->expects($this->any())
->method('acl_get')
->with($this->anything())

View File

@@ -80,7 +80,9 @@ class phpbb_unit_modules_calendar_test extends \board3\portal\tests\testframewor
$this->calendar = new \board3\portal\modules\calendar(self::$config, $modules_helper, $this->template, $db, $this->request, dirname(__FILE__) . '/../../../', 'php', $user, $this->path_helper, $log);
define('PORTAL_MODULES_TABLE', 'phpbb_portal_modules');
define('PORTAL_CONFIG_TABLE', 'phpbb_portal_config');
$cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put'));
$cache = $this->getMockBuilder('\phpbb\cache\driver\dummy')
->setMethods(['destroy', 'sql_exists', 'get', 'put'])
->getMock();
$cache->expects($this->any())
->method('destroy')
->with($this->equalTo('portal_config'));

View File

@@ -48,7 +48,9 @@ class phpbb_unit_modules_welcome_test extends \board3\portal\tests\testframework
$this->language = new \phpbb\language\language($this->language_file_loader);
$this->user = new \phpbb\user($this->language, '\phpbb\datetime');
$user = $this->user;
$cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put', 'sql_load'));
$cache = $this->getMockBuilder('\phpbb\cache\driver\dummy')
->setMethods(['destroy', 'sql_exists', 'get', 'put', 'sql_load'])
->getMock();
$cache->expects($this->any())
->method('destroy')
->with($this->equalTo('portal_config'));
@@ -74,12 +76,16 @@ class phpbb_unit_modules_welcome_test extends \board3\portal\tests\testframework
->with($this->anything())
->will($this->returnArgument(1));
$phpbb_container = new \phpbb_mock_container_builder();
$phpbb_log = $this->getMockBuilder('\phpbb\log\log')
->disableOriginalConstructor()
->getMock();
$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,
$config,
new \phpbb\textformatter\s9e\link_helper(),
$phpbb_log,
$phpbb_root_path . 'cache',
'_text_formatter_parser',
'_text_formatter_renderer'