@@ -21,6 +21,7 @@ class phpbb_console_command_cron_run_all_test extends phpbb_database_test_case
2121 protected $ user ;
2222 protected $ cron_manager ;
2323 protected $ command_name ;
24+ protected $ task ;
2425
2526 public function getDataSet ()
2627 {
@@ -40,8 +41,9 @@ public function setUp()
4041 $ this ->user = $ this ->getMock ('\phpbb\user ' );
4142 $ this ->user ->method ('lang ' )->will ($ this ->returnArgument (0 ));
4243
44+ $ this ->task = new phpbb_cron_task_simple ();
4345 $ tasks = array (
44- new phpbb_cron_task_simple () ,
46+ $ this -> task ,
4547 );
4648 $ this ->cron_manager = new \phpbb \cron \manager ($ tasks , $ phpbb_root_path , $ pathEx );
4749
@@ -58,7 +60,7 @@ public function test_normal_use()
5860 $ command_tester ->execute (array ('command ' => $ this ->command_name ));
5961
6062 $ this ->assertSame ('' , $ command_tester ->getDisplay ());
61- $ this ->assertSame (1 , $ cron_num_exec );
63+ $ this ->assertSame (true , $ this -> task -> executed );
6264 }
6365
6466 public function test_verbose_mode ()
@@ -69,7 +71,7 @@ public function test_verbose_mode()
6971 $ command_tester ->execute (array ('command ' => $ this ->command_name , '--verbose ' => true ));
7072
7173 $ this ->assertContains ('RUNNING_TASK ' , $ command_tester ->getDisplay ());
72- $ this ->assertSame (1 , $ cron_num_exec );
74+ $ this ->assertSame (true , $ this -> task -> executed );
7375 }
7476
7577 public function test_error_lock ()
@@ -81,7 +83,7 @@ public function test_error_lock()
8183 $ command_tester ->execute (array ('command ' => $ this ->command_name ));
8284
8385 $ this ->assertContains ('CRON_LOCK_ERROR ' , $ command_tester ->getDisplay ());
84- $ this ->assertSame (0 , $ cron_num_exec );
86+ $ this ->assertSame (false , $ this -> task -> executed );
8587 }
8688
8789 public function get_command_tester ()
0 commit comments