aboutsummaryrefslogtreecommitdiffstats
path: root/tests/console
diff options
context:
space:
mode:
authorMatt Friedman <maf675@gmail.com>2016-02-29 14:23:32 -0800
committerMatt Friedman <maf675@gmail.com>2016-02-29 14:23:32 -0800
commitfe31060fca4a07696029c50af2c74c88ab5d85fe (patch)
tree38560111c28002e2881c3a1b4aa87924ae9a0699 /tests/console
parent637b02690db0d3b7af2915c1da4bacc8fa054f6c (diff)
downloadforums-fe31060fca4a07696029c50af2c74c88ab5d85fe.tar
forums-fe31060fca4a07696029c50af2c74c88ab5d85fe.tar.gz
forums-fe31060fca4a07696029c50af2c74c88ab5d85fe.tar.bz2
forums-fe31060fca4a07696029c50af2c74c88ab5d85fe.tar.xz
forums-fe31060fca4a07696029c50af2c74c88ab5d85fe.zip
[ticket/12684] Fix tests
PHPBB3-12684
Diffstat (limited to 'tests/console')
-rw-r--r--tests/console/user/add_test.php22
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/console/user/add_test.php b/tests/console/user/add_test.php
index a673d5eb6c..8fc921babf 100644
--- a/tests/console/user/add_test.php
+++ b/tests/console/user/add_test.php
@@ -24,9 +24,10 @@ class phpbb_console_command_user_add_test extends phpbb_database_test_case
protected $db;
protected $config;
protected $user;
+ protected $language;
protected $passwords_manager;
protected $command_name;
- protected $dialog;
+ protected $question;
protected $phpbb_root_path;
protected $php_ext;
@@ -59,11 +60,16 @@ class phpbb_console_command_user_add_test extends phpbb_database_test_case
$db = $this->db = $this->new_dbal();
+ $this->language = $this->getMockBuilder('\phpbb\language\language')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->language->expects($this->any())
+ ->method('lang')
+ ->will($this->returnArgument(0));
$user = $this->user = $this->getMock('\phpbb\user', array(), array(
- new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)),
- '\phpbb\datetime')
- );
- $this->user->method('lang')->will($this->returnArgument(0));
+ $this->language,
+ '\phpbb\datetime'
+ ));
$driver_helper = new \phpbb\passwords\driver\helper($this->config);
$passwords_drivers = array(
@@ -105,7 +111,7 @@ class phpbb_console_command_user_add_test extends phpbb_database_test_case
$this->assertEquals(2, $this->get_user_id('Admin'));
- $this->dialog->setInputStream($this->getInputStream("bar\npassword\npassword\nbar@test.com\n"));
+ $this->question->setInputStream($this->getInputStream("bar\npassword\npassword\nbar@test.com\n"));
$command_tester->execute(array(
'command' => $this->command_name,
@@ -137,11 +143,11 @@ class phpbb_console_command_user_add_test extends phpbb_database_test_case
public function get_command_tester()
{
$application = new Application();
- $application->add(new add($this->user, $this->db, $this->config, $this->passwords_manager, $this->phpbb_root_path, $this->php_ext));
+ $application->add(new add($this->user, $this->db, $this->config, $this->language, $this->passwords_manager, $this->phpbb_root_path, $this->php_ext));
$command = $application->find('user:add');
$this->command_name = $command->getName();
- $this->dialog = $command->getHelper('dialog');
+ $this->question = $command->getHelper('question');
return new CommandTester($command);
}