diff options
author | Tristan Darricau <github@nicofuma.fr> | 2014-08-23 12:45:25 +0200 |
---|---|---|
committer | Tristan Darricau <github@nicofuma.fr> | 2014-08-23 12:45:25 +0200 |
commit | 91804b53fb262a4d7806edc51caedc9e12c71a75 (patch) | |
tree | 053f5ebcb94668ba02f0c87695dced21017b4c2e /tests/console/config/config_test.php | |
parent | 5a4de4aa1f26596ecee53ba2573947d73dc77ab7 (diff) | |
download | forums-91804b53fb262a4d7806edc51caedc9e12c71a75.tar forums-91804b53fb262a4d7806edc51caedc9e12c71a75.tar.gz forums-91804b53fb262a4d7806edc51caedc9e12c71a75.tar.bz2 forums-91804b53fb262a4d7806edc51caedc9e12c71a75.tar.xz forums-91804b53fb262a4d7806edc51caedc9e12c71a75.zip |
[ticket/12658] Rebased and fixed unit tests
PHPBB3-12658
Diffstat (limited to 'tests/console/config/config_test.php')
-rw-r--r-- | tests/console/config/config_test.php | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/console/config/config_test.php b/tests/console/config/config_test.php index b8d30d314f..7c098af004 100644 --- a/tests/console/config/config_test.php +++ b/tests/console/config/config_test.php @@ -18,10 +18,14 @@ class phpbb_console_command_config_test extends phpbb_test_case { protected $config; protected $command_name; + protected $user; public function setUp() { $this->config = new \phpbb\config\config(array()); + + $this->user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime')); + $this->user->method('lang')->will($this->returnArgument(0)); } public function test_set_dynamic() @@ -153,7 +157,7 @@ class phpbb_console_command_config_test extends phpbb_test_case '--no-newline' => false, )); - $this->assertContains('Could not get config', $command_tester->getDisplay()); + $this->assertContains('CLI_CONFIG_NOT_EXISTS', $command_tester->getDisplay()); } public function test_increment_dynamic() @@ -169,7 +173,7 @@ class phpbb_console_command_config_test extends phpbb_test_case '--dynamic' => true, )); - $this->assertContains('Successfully incremented config test_key', $command_tester->getDisplay()); + $this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay()); $this->assertSame(2, $this->config['test_key']); } @@ -186,7 +190,7 @@ class phpbb_console_command_config_test extends phpbb_test_case '--dynamic' => false, )); - $this->assertContains('Successfully incremented config test_key', $command_tester->getDisplay()); + $this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay()); $this->assertSame(2, $this->config['test_key']); } @@ -202,7 +206,7 @@ class phpbb_console_command_config_test extends phpbb_test_case '--dynamic' => true, )); - $this->assertContains('Successfully incremented config test_key', $command_tester->getDisplay()); + $this->assertContains('CLI_CONFIG_INCREMENT_SUCCESS', $command_tester->getDisplay()); $this->assertSame(2, $this->config['test_key']); } @@ -217,7 +221,7 @@ class phpbb_console_command_config_test extends phpbb_test_case 'key' => 'test_key', )); - $this->assertContains('Successfully deleted config test_key', $command_tester->getDisplay()); + $this->assertContains('CLI_CONFIG_DELETE_SUCCESS', $command_tester->getDisplay()); $this->assertEmpty($this->config); } @@ -231,7 +235,7 @@ class phpbb_console_command_config_test extends phpbb_test_case 'key' => 'wrong_key', )); - $this->assertContains('Config wrong_key does not exist', $command_tester->getDisplay()); + $this->assertContains('CLI_CONFIG_NOT_EXISTS', $command_tester->getDisplay()); $this->assertEmpty($this->config); } @@ -239,7 +243,7 @@ class phpbb_console_command_config_test extends phpbb_test_case { $command_complete_name = '\phpbb\console\command\config' . '\\' . $class_name; $application = new Application(); - $application->add(new $command_complete_name($this->config)); + $application->add(new $command_complete_name($this->user, $this->config)); $command = $application->find('config:' . $this->command_name); $this->command_name = $command->getName(); return new CommandTester($command); |