@@ -318,7 +318,7 @@ public function testGetVncConsole(Server $createdServer)
318318 {
319319 /** @var array $console */
320320 require_once $ this ->sampleFile ('servers/get_server_vnc_console.php ' , [
321- '{serverId} ' => $ createdServer ->id
321+ '{serverId} ' => $ createdServer ->id ,
322322 ]);
323323
324324 $ this ->assertIsArray ($ console );
@@ -331,6 +331,9 @@ public function testGetVncConsole(Server $createdServer)
331331 */
332332 public function testGetConsoleOutput (Server $ createdServer )
333333 {
334+ // wait for the server to be ready
335+ sleep (5 );
336+
334337 /** @var string $consoleOutput */
335338 require_once $ this ->sampleFile ('servers/get_server_console_output.php ' , ['{serverId} ' => $ createdServer ->id ]);
336339
@@ -361,4 +364,31 @@ public function testDelete(Server $createdServer)
361364 $ this ->expectException (BadResponseError::class);
362365 $ createdServer ->retrieve ();
363366 }
367+
368+ public function testSuspend ()
369+ {
370+ $ server = $ this ->createServer ();
371+
372+ require_once $ this ->sampleFile ('servers/suspend.php ' , ['{serverId} ' => $ server ->id ]);
373+
374+ $ server ->waitUntil ('SUSPENDED ' );
375+ $ this ->assertEquals ('SUSPENDED ' , $ server ->status );
376+
377+ return $ server ;
378+ }
379+
380+ /**
381+ * @depends testSuspend
382+ */
383+ public function testResume (Server $ server )
384+ {
385+ $ this ->assertEquals ('SUSPENDED ' , $ server ->status );
386+
387+ require_once $ this ->sampleFile ('servers/resume.php ' , ['{serverId} ' => $ server ->id ]);
388+
389+ $ server ->waitUntil ('ACTIVE ' , 300 );
390+ $ this ->assertEquals ('ACTIVE ' , $ server ->status );
391+
392+ $ this ->deleteServer ($ server );
393+ }
364394}
0 commit comments