@@ -24,9 +24,10 @@ class phpbb_console_command_user_add_test extends phpbb_database_test_case
2424 protected $ db ;
2525 protected $ config ;
2626 protected $ user ;
27+ protected $ language ;
2728 protected $ passwords_manager ;
2829 protected $ command_name ;
29- protected $ dialog ;
30+ protected $ question ;
3031 protected $ phpbb_root_path ;
3132 protected $ php_ext ;
3233
@@ -59,11 +60,16 @@ public function setUp()
5960
6061 $ db = $ this ->db = $ this ->new_dbal ();
6162
63+ $ this ->language = $ this ->getMockBuilder ('\phpbb\language\language ' )
64+ ->disableOriginalConstructor ()
65+ ->getMock ();
66+ $ this ->language ->expects ($ this ->any ())
67+ ->method ('lang ' )
68+ ->will ($ this ->returnArgument (0 ));
6269 $ user = $ this ->user = $ this ->getMock ('\phpbb\user ' , array (), array (
63- new \phpbb \language \language (new \phpbb \language \language_file_loader ($ phpbb_root_path , $ phpEx )),
64- '\phpbb\datetime ' )
65- );
66- $ this ->user ->method ('lang ' )->will ($ this ->returnArgument (0 ));
70+ $ this ->language ,
71+ '\phpbb\datetime '
72+ ));
6773
6874 $ driver_helper = new \phpbb \passwords \driver \helper ($ this ->config );
6975 $ passwords_drivers = array (
@@ -105,7 +111,7 @@ public function test_add_dialog()
105111
106112 $ this ->assertEquals (2 , $ this ->get_user_id ('Admin ' ));
107113
108- $ this ->dialog ->setInputStream ($ this ->getInputStream ("bar \npassword \npassword \nbar@test.com \n" ));
114+ $ this ->question ->setInputStream ($ this ->getInputStream ("bar \npassword \npassword \nbar@test.com \n" ));
109115
110116 $ command_tester ->execute (array (
111117 'command ' => $ this ->command_name ,
@@ -137,11 +143,11 @@ public function test_add_no_dialog_invalid()
137143 public function get_command_tester ()
138144 {
139145 $ application = new Application ();
140- $ application ->add (new add ($ this ->user , $ this ->db , $ this ->config , $ this ->passwords_manager , $ this ->phpbb_root_path , $ this ->php_ext ));
146+ $ application ->add (new add ($ this ->user , $ this ->db , $ this ->config , $ this ->language , $ this -> passwords_manager , $ this ->phpbb_root_path , $ this ->php_ext ));
141147
142148 $ command = $ application ->find ('user:add ' );
143149 $ this ->command_name = $ command ->getName ();
144- $ this ->dialog = $ command ->getHelper ('dialog ' );
150+ $ this ->question = $ command ->getHelper ('question ' );
145151 return new CommandTester ($ command );
146152 }
147153
0 commit comments