[ticket/690] Make tests compatible with latest version of phpunit & phpBB
B3P-690
This commit is contained in:
@@ -34,7 +34,9 @@ class phpbb_portal_fetch_posts_test extends \board3\portal\tests\testframework\d
|
||||
$user->add_lang('common');
|
||||
$user->add_lang('../../ext/board3/portal/language/en/portal');
|
||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('obtain_word_list', 'get', 'sql_exists', 'put', 'obtain_attach_extensions', 'sql_load', 'sql_save'));
|
||||
$cache = $this->getMockBuilder('\phpbb\cache\driver\dummy')
|
||||
->setMethods(['obtain_word_list', 'get', 'sql_exists', 'put', 'obtain_attach_extensions', 'sql_load', 'sql_save'])
|
||||
->getMock();
|
||||
$cache->expects($this->any())
|
||||
->method('obtain_word_list')
|
||||
->with()
|
||||
@@ -67,7 +69,9 @@ class phpbb_portal_fetch_posts_test extends \board3\portal\tests\testframework\d
|
||||
$controller_helper->add_route('board3_portal_controller', 'portal');
|
||||
$this->modules_helper = new \board3\portal\includes\modules_helper($auth, $this->config, $controller_helper, new phpbb_mock_request());
|
||||
$this->user = $user;
|
||||
$template = $this->getMock('\phpbb\template', array('set_filenames', 'destroy_block_vars', 'assign_block_vars', 'assign_display'));
|
||||
$template = $this->getMockBuilder('\phpbb\template')
|
||||
->setMethods(['set_filenames', 'destroy_block_vars', 'assign_block_vars', 'assign_display'])
|
||||
->getMock();
|
||||
$this->fetch_posts = new \board3\portal\portal\fetch_posts($auth, $cache, $this->config, $this->db, $this->modules_helper, $user);
|
||||
}
|
||||
|
||||
@@ -202,7 +206,7 @@ class phpbb_portal_fetch_posts_test extends \board3\portal\tests\testframework\d
|
||||
|
||||
if ($expected_exception)
|
||||
{
|
||||
$this->setExpectedException($expected_exception);
|
||||
$this->expectException($expected_exception);
|
||||
}
|
||||
|
||||
$this->fetch_posts->set_module_id($module_id);
|
||||
@@ -244,7 +248,9 @@ class phpbb_portal_fetch_posts_test extends \board3\portal\tests\testframework\d
|
||||
{
|
||||
global $cache;
|
||||
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('obtain_word_list', 'get', 'sql_exists', 'put'));
|
||||
$cache = $this->getMockBuilder('\phpbb\cache\driver\dummy')
|
||||
->setMethods(['obtain_word_list', 'get', 'sql_exists', 'put'])
|
||||
->getMock();
|
||||
$cache->expects($this->any())
|
||||
->method('obtain_word_list')
|
||||
->with()
|
||||
|
||||
@@ -63,7 +63,9 @@ class modules_manager_confirm_box_test extends \board3\portal\tests\testframewor
|
||||
));
|
||||
|
||||
$this->portal_columns = new \board3\portal\portal\columns();
|
||||
$this->cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put', 'purge'));
|
||||
$this->cache = $this->getMockBuilder('\phpbb\cache\driver\dummy')
|
||||
->setMethods(['destroy', 'sql_exists', 'get', 'put', 'purge'])
|
||||
->getMock();
|
||||
$this->cache->expects($this->any())
|
||||
->method('destroy')
|
||||
->withConsecutive(array($this->equalTo('config')), array($this->equalTo('portal_config')));
|
||||
@@ -147,7 +149,9 @@ class modules_manager_confirm_box_test extends \board3\portal\tests\testframewor
|
||||
|
||||
public function test_module_delete()
|
||||
{
|
||||
$this->cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put', 'purge'));
|
||||
$this->cache = $this->getMockBuilder('\phpbb\cache\driver\dummy')
|
||||
->setMethods(['destroy', 'sql_exists', 'get', 'put', 'purge'])
|
||||
->getMock();
|
||||
$this->cache->expects($this->any())
|
||||
->method('destroy')
|
||||
->with($this->equalTo('sql'));
|
||||
|
||||
@@ -55,7 +55,9 @@ class board3_portal_modules_manager_test extends \board3\portal\tests\testframew
|
||||
));
|
||||
|
||||
$this->portal_columns = new \board3\portal\portal\columns();
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('destroy', 'sql_exists', 'get', 'put', 'sql_load', 'sql_save'));
|
||||
$cache = $this->getMockBuilder('\phpbb\cache\driver\dummy')
|
||||
->setMethods(['destroy', 'sql_exists', 'get', 'put', 'sql_load', 'sql_save'])
|
||||
->getMock();
|
||||
$cache->expects($this->any())
|
||||
->method('destroy')
|
||||
->with($this->equalTo('portal_modules'));
|
||||
|
||||
Reference in New Issue
Block a user