@@ -108,12 +108,37 @@ public function testDeleteUsers()
108108 $ response = $ this ->client ->deleteUsers ([$ user ["id " ]], ["user " => "hard " ]);
109109 $ this ->assertTrue (array_key_exists ("task_id " , $ response ));
110110 $ taskId = $ response ["task_id " ];
111- for ($ i =0 ;$ i <10 ;$ i ++) {
111+ for ($ i =0 ;$ i <30 ;$ i ++) {
112+ $ response = $ this ->client ->getTask ($ taskId );
113+ if ($ response ["status " ] == "completed " ) {
114+ $ this ->assertSame ($ response ["result " ][$ user ["id " ]]["status " ], "ok " );
115+ return ;
116+ }
117+ usleep (300000 );
118+ }
119+ $ this ->assertSame ($ response ["status " ], "completed " );
120+ }
121+
122+ public function testDeleteChannels ()
123+ {
124+ $ user = ["id " => Uuid::uuid4 ()->toString ()];
125+ $ response = $ this ->client ->updateUser ($ user );
126+
127+ $ c1 = $ this ->getChannel ();
128+ $ c2 = $ this ->getChannel ();
129+
130+ $ response = $ this ->client ->deleteChannels ([$ c1 ->getCID (), $ c2 ->getCID ()], ["hard_delete " => true ]);
131+ $ this ->assertTrue (array_key_exists ("task_id " , $ response ));
132+
133+ $ taskId = $ response ["task_id " ];
134+ for ($ i =0 ;$ i <30 ;$ i ++) {
112135 $ response = $ this ->client ->getTask ($ taskId );
113136 if ($ response ["status " ] == "completed " ) {
137+ $ this ->assertSame ($ response ["result " ][$ c1 ->getCID ()]["status " ], "ok " );
138+ $ this ->assertSame ($ response ["result " ][$ c2 ->getCID ()]["status " ], "ok " );
114139 return ;
115140 }
116- sleep ( 1 );
141+ usleep ( 300000 );
117142 }
118143 $ this ->assertSame ($ response ["status " ], "completed " );
119144 }
0 commit comments