Skip to content

Commit

Permalink
Merge pull request #60 from clue-labs/tests
Browse files Browse the repository at this point in the history
Fix failing tests with new Docker Engine API
  • Loading branch information
clue authored Mar 21, 2020
2 parents 43a47f4 + 0bfc2b2 commit dac2915
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions tests/FunctionalClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function testCreateStartAndRemoveContainer()
$container = Block\await($promise, $this->loop);

$this->assertNotNull($container['Id']);
$this->assertNull($container['Warnings']);
$this->assertEmpty($container['Warnings']);

$start = microtime(true);

Expand Down Expand Up @@ -108,7 +108,7 @@ public function testStartRunning()
$container = Block\await($promise, $this->loop);

$this->assertNotNull($container['Id']);
$this->assertNull($container['Warnings']);
$this->assertEmpty($container['Warnings']);

$promise = $this->client->containerStart($container['Id']);
$ret = Block\await($promise, $this->loop);
Expand Down Expand Up @@ -434,9 +434,6 @@ public function testCreateConnectDisconnectAndRemoveNetwork()
$promise = $this->client->containerCreate($containerConfig);
$container = Block\await($promise, $this->loop);

$promise = $this->client->containerStart($container['Id']);
$ret = Block\await($promise, $this->loop);

$start = microtime(true);

$promise = $this->client->networkCreate($networkName);
Expand All @@ -462,21 +459,16 @@ public function testCreateConnectDisconnectAndRemoveNetwork()

$end = microtime(true);

$promise = $this->client->containerStop($container['Id']);
$ret = Block\await($promise, $this->loop);

$promise = $this->client->containerRemove($container['Id']);
$ret = Block\await($promise, $this->loop);

// get all events between starting and removing for this container
$promise = $this->client->events($start, $end, array('network' => array($network['Id'])));
$ret = Block\await($promise, $this->loop);

// expects "create", "connect", "disconnect", "destroy" events
//$this->assertEquals(4, count($ret));
// expects "create", "disconnect", "destroy" events ("connect" will be skipped because we don't start the container)
$this->assertEquals(3, count($ret));
$this->assertEquals('create', $ret[0]['Action']);
//$this->assertEquals('connect', $ret[1]['Action']);
$this->assertEquals('disconnect', $ret[1]['Action']);
$this->assertEquals('destroy', $ret[2]['Action']);
}
Expand Down

0 comments on commit dac2915

Please sign in to comment.