Skip to content

Commit

Permalink
Add test for handling 400 responses on populate.
Browse files Browse the repository at this point in the history
  • Loading branch information
ihsw committed Jan 23, 2018
1 parent 4e4fad3 commit 76ab702
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/ToxiproxyTest.php
Expand Up @@ -7,6 +7,7 @@
use Ihsw\Toxiproxy\Proxy;
use Ihsw\Toxiproxy\Exception\ProxyExistsException;
use Ihsw\Toxiproxy\Exception\NotFoundException;
use Ihsw\Toxiproxy\Exception\InvalidProxyException;

class ToxiproxyTest extends AbstractTest
{
Expand Down Expand Up @@ -83,6 +84,21 @@ public function testPopulate()
$this->removeProxy($toxiproxy, $proxies[0]);
}

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

try {
$toxiproxy->populate(["bullshit" => "yes"]);
} catch (\Exception $e) {
$this->assertInstanceOf(InvalidProxyException::class, $e);

return;
}

$this->assertTrue(false);
}

public function testGet()
{
$toxiproxy = $this->createToxiproxy();
Expand Down

0 comments on commit 76ab702

Please sign in to comment.