33use Clue \React \Docker \Client ;
44use React \EventLoop \Factory as LoopFactory ;
55use Clue \React \Docker \Factory ;
6+ use Clue \React \Block ;
67
78class FunctionalClientTest extends TestCase
89{
@@ -19,7 +20,7 @@ public function setUp()
1920 $ promise = $ this ->client ->ping ();
2021
2122 try {
22- $ this -> waitFor ($ promise , $ this ->loop );
23+ Block \await ($ promise , $ this ->loop );
2324 } catch (Exception $ e ) {
2425 $ this ->markTestSkipped ('Unable to connect to docker ' . $ e ->getMessage ());
2526 }
@@ -40,18 +41,18 @@ public function testCreateStartAndRemoveContainer()
4041 );
4142
4243 $ promise = $ this ->client ->containerCreate ($ config );
43- $ container = $ this -> waitFor ($ promise , $ this ->loop );
44+ $ container = Block \await ($ promise , $ this ->loop );
4445
4546 $ this ->assertNotNull ($ container ['Id ' ]);
4647 $ this ->assertNull ($ container ['Warnings ' ]);
4748
4849 $ promise = $ this ->client ->containerStart ($ container ['Id ' ]);
49- $ ret = $ this -> waitFor ($ promise , $ this ->loop );
50+ $ ret = Block \await ($ promise , $ this ->loop );
5051
5152 $ this ->assertEquals ('' , $ ret );
5253
5354 $ promise = $ this ->client ->containerRemove ($ container ['Id ' ], false , true );
54- $ ret = $ this -> waitFor ($ promise , $ this ->loop );
55+ $ ret = Block \await ($ promise , $ this ->loop );
5556
5657 $ this ->assertEquals ('' , $ ret );
5758 }
@@ -62,13 +63,13 @@ public function testCreateStartAndRemoveContainer()
6263 public function testContainerRemoveInvalid ()
6364 {
6465 $ promise = $ this ->client ->containerRemove ('invalid123 ' );
65- $ this -> waitFor ($ promise , $ this ->loop );
66+ Block \await ($ promise , $ this ->loop );
6667 }
6768
6869 public function testImageSearch ()
6970 {
7071 $ promise = $ this ->client ->imageSearch ('clue ' );
71- $ ret = $ this -> waitFor ($ promise , $ this ->loop );
72+ $ ret = Block \await ($ promise , $ this ->loop );
7273
7374 $ this ->assertGreaterThan (9 , count ($ ret ));
7475 }
@@ -77,11 +78,11 @@ public function testImageTag()
7778 {
7879 // create new tag "bb:now" on "busybox:latest"
7980 $ promise = $ this ->client ->imageTag ('busybox ' , 'bb ' , 'now ' );
80- $ ret = $ this -> waitFor ($ promise , $ this ->loop );
81+ $ ret = Block \await ($ promise , $ this ->loop );
8182
8283 // delete tag "bb:now" again
8384 $ promise = $ this ->client ->imageRemove ('bb:now ' );
84- $ ret = $ this -> waitFor ($ promise , $ this ->loop );
85+ $ ret = Block \await ($ promise , $ this ->loop );
8586 }
8687
8788 public function testImageCreateStreamMissingWillEmitJsonError ()
0 commit comments