[ticket/331] Specify datetime class in tests
This commit is contained in:
@@ -36,7 +36,7 @@ class helper_test extends \board3\portal\tests\testframework\test_case
|
||||
'board3_enable' => true,
|
||||
));
|
||||
$this->template = new \board3\portal\tests\mock\template($this);
|
||||
$this->user = $this->getMock('\phpbb\user', array('add_lang_ext'));
|
||||
$this->user = $this->getMock('\phpbb\user', array('add_lang_ext'), array('\phpbb\datetime'));
|
||||
$this->user->data['group_id'] = 2;
|
||||
$this->phpbb_root_path = dirname(__FILE__) . '/../../../../../../';
|
||||
$this->php_ext = 'php';
|
||||
|
||||
@@ -32,7 +32,7 @@ class listener_test extends \phpbb_template_template_test_case
|
||||
|
||||
public function setup_listener()
|
||||
{
|
||||
$this->user = $this->getMock('\phpbb\user');
|
||||
$this->user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
|
||||
$this->user->expects($this->any())
|
||||
->method('lang')
|
||||
->will($this->returnValue('foo'));
|
||||
|
||||
@@ -22,7 +22,7 @@ class phpbb_functions_fetch_news_test extends \board3\portal\tests\testframework
|
||||
|
||||
global $auth, $cache, $config, $phpbb_container, $phpbb_dispatcher, $template, $user;
|
||||
|
||||
$user = new \phpbb\user();
|
||||
$user = new \phpbb\user('\phpbb\datetime');
|
||||
$user->data['user_id'] = 2;
|
||||
$user->timezone = new \DateTimeZone('UTC');
|
||||
$user->add_lang('common');
|
||||
|
||||
@@ -24,7 +24,7 @@ class phpbb_unit_functions_functions_test extends \board3\portal\tests\testframe
|
||||
|
||||
parent::setUp();
|
||||
|
||||
$user = $this->getMock('\phpbb\user', array('optionget'));
|
||||
$user = $this->getMock('\phpbb\user', array('optionget'), array('\phpbb\datetime'));
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('obtain_word_list', 'sql_exists'));
|
||||
$cache->expects($this->any())
|
||||
->method('obtain_word_list')
|
||||
|
||||
@@ -22,7 +22,7 @@ class phpbb_unit_functions_get_user_groups_test extends \board3\portal\tests\tes
|
||||
|
||||
parent::setUp();
|
||||
|
||||
$user = $this->getMock('\phpbb\user', array('optionget'));
|
||||
$user = $this->getMock('\phpbb\user', array('optionget'), array('\phpbb\datetime'));
|
||||
$cache = $this->getMock('\phpbb\cache\cache', array('get', 'put', 'sql_exists'));
|
||||
$cache->expects($this->any())
|
||||
->method('get')
|
||||
|
||||
@@ -23,7 +23,7 @@ class phpbb_portal_fetch_posts_test extends \board3\portal\tests\testframework\d
|
||||
|
||||
parent::setUp();
|
||||
|
||||
$user = new \phpbb\user();
|
||||
$user = new \phpbb\user('\phpbb\datetime');
|
||||
$user->data['user_id'] = 2;
|
||||
$user->timezone = new \DateTimeZone('UTC');
|
||||
$user->add_lang('common');
|
||||
@@ -50,8 +50,7 @@ class phpbb_portal_fetch_posts_test extends \board3\portal\tests\testframework\d
|
||||
// Pretend to allow downloads in forum 1
|
||||
$auth->acl[1][0] = true;
|
||||
$this->auth = $auth;
|
||||
$request = new \phpbb_mock_request;
|
||||
$this->modules_helper = new \board3\portal\includes\modules_helper($auth, $this->config, $request);
|
||||
$this->modules_helper = new \board3\portal\includes\modules_helper($auth);
|
||||
$this->user = $user;
|
||||
$template = $this->getMock('\phpbb\template', array('set_filenames', 'destroy_block_vars', 'assign_block_vars', 'assign_display'));
|
||||
$this->fetch_posts = new \board3\portal\portal\fetch_posts($auth, $cache, $this->config, $this->db, $this->modules_helper, $user);
|
||||
|
||||
Reference in New Issue
Block a user