diff options
author | Matt Friedman <maf675@gmail.com> | 2016-02-29 11:38:49 -0800 |
---|---|---|
committer | Matt Friedman <maf675@gmail.com> | 2016-02-29 11:41:07 -0800 |
commit | 6fe084a2fd967c188bdca827a46647120a5ea58d (patch) | |
tree | 3479fea79ef9f71173f7b64b01179804fa9ab0c3 /tests/console/user | |
parent | d17a8ab523f5cc77352170c679767c5523f57ec9 (diff) | |
download | forums-6fe084a2fd967c188bdca827a46647120a5ea58d.tar forums-6fe084a2fd967c188bdca827a46647120a5ea58d.tar.gz forums-6fe084a2fd967c188bdca827a46647120a5ea58d.tar.bz2 forums-6fe084a2fd967c188bdca827a46647120a5ea58d.tar.xz forums-6fe084a2fd967c188bdca827a46647120a5ea58d.zip |
[ticket/12684] Updates for 3.2 API
PHPBB3-12684
Diffstat (limited to 'tests/console/user')
-rw-r--r-- | tests/console/user/add_test.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/console/user/add_test.php b/tests/console/user/add_test.php index 6f80a8658a..5e4b76063e 100644 --- a/tests/console/user/add_test.php +++ b/tests/console/user/add_test.php @@ -27,6 +27,8 @@ class phpbb_console_command_user_add_test extends phpbb_database_test_case protected $passwords_manager; protected $command_name; protected $dialog; + protected $phpbb_root_path; + protected $php_ext; public function getDataSet() { @@ -35,22 +37,26 @@ class phpbb_console_command_user_add_test extends phpbb_database_test_case public function setUp() { - global $db, $config, $phpbb_dispatcher, $phpbb_container; + global $db, $cache, $config, $user, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path, $phpEx; $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); $phpbb_container = new phpbb_mock_container_builder(); $phpbb_container->set('cache.driver', new phpbb_mock_cache()); + $phpbb_container->set('notification_manager', new phpbb_mock_notification_manager()); + + $cache = $phpbb_container->get('cache.driver'); $config = $this->config = new \phpbb\config\config(array( 'board_timezone' => 'UTC', 'default_lang' => 'en', )); - set_config(null, null, null, $this->config); - set_config_count(null, null, null, $this->config); $db = $this->db = $this->new_dbal(); - $this->user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime')); + $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)); $driver_helper = new \phpbb\passwords\driver\helper($this->config); @@ -64,6 +70,9 @@ class phpbb_console_command_user_add_test extends phpbb_database_test_case $passwords_helper = new \phpbb\passwords\helper; $this->passwords_manager = new \phpbb\passwords\manager($this->config, $passwords_drivers, $passwords_helper, array_keys($passwords_drivers)); + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $phpEx; + parent::setUp(); } @@ -104,7 +113,7 @@ 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)); + $application->add(new add($this->user, $this->db, $this->config, $this->passwords_manager, $this->phpbb_root_path, $this->php_ext)); $command = $application->find('user:add'); $this->command_name = $command->getName(); |