aboutsummaryrefslogtreecommitdiffstats
path: root/tests/console/user/base.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/console/user/base.php')
-rw-r--r--tests/console/user/base.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/console/user/base.php b/tests/console/user/base.php
index ad328ac893..74f04cf686 100644
--- a/tests/console/user/base.php
+++ b/tests/console/user/base.php
@@ -20,6 +20,7 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case
protected $log;
protected $passwords_manager;
protected $command_name;
+ /** @var Symfony\Component\Console\Helper\QuestionHelper */
protected $question;
protected $user_loader;
protected $phpbb_root_path;
@@ -30,7 +31,7 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case
return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
}
- public function setUp()
+ public function setUp(): void
{
global $auth, $db, $cache, $config, $user, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path, $phpEx;
@@ -39,7 +40,7 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case
$phpbb_container->set('cache.driver', new phpbb_mock_cache());
$phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
- $auth = $this->getMock('\phpbb\auth\auth');
+ $auth = $this->createMock('\phpbb\auth\auth');
$cache = $phpbb_container->get('cache.driver');
@@ -50,7 +51,6 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case
'min_name_chars' => 3,
'max_name_chars' => 10,
'min_pass_chars' => 3,
- 'max_pass_chars' => 10,
'pass_complex' => 'PASS_TYPE_ANY',
));
@@ -62,7 +62,7 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case
$this->language->expects($this->any())
->method('lang')
->will($this->returnArgument(0));
- $user = $this->user = $this->getMock('\phpbb\user', array(), array(
+ $user = $this->user = $this->createMock('\phpbb\user', array(), array(
$this->language,
'\phpbb\datetime'
));
@@ -112,7 +112,8 @@ abstract class phpbb_console_user_base extends phpbb_database_test_case
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);
- return $row['user_id'];
+ $user_id = $row ? $row['user_id'] : null;
+ return $user_id;
}
public function getInputStream($input)