Skip to content

Commit

Permalink
Add test for checking proxy disabling.
Browse files Browse the repository at this point in the history
  • Loading branch information
ihsw committed Jan 6, 2018
1 parent 7e53f26 commit d3843a4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/Test/AssertionHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ public function assertConnection(array $options, $message = null)
->then(function (ConnectionInterface $conn) use ($clientLoop) {
$conn->close();
return true;
}, function (\Exception $e) {
throw $e;
}, function () {
return false;
});
$clientLoop->run();
Expand Down
14 changes: 14 additions & 0 deletions tests/ToxiproxyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,18 @@ public function testUpdate()

$toxiproxy->delete($updatedProxy);
}

public function testUpdateDisabled()
{
$toxiproxy = $this->createToxiproxy();

$proxy = $this->createProxy($toxiproxy);
$this->assertProxyAvailable($proxy);

$proxy->setEnabled(false);
$proxy = $toxiproxy->update($proxy);
$this->assertProxyUnavailable($proxy);

$toxiproxy->delete($proxy);
}
}

0 comments on commit d3843a4

Please sign in to comment.