Skip to content

Commit

Permalink
Cleanup channels after functional tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Smith committed Mar 15, 2016
1 parent 65ed736 commit 5941b16
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/wormling/phparia/Tests/Functional/PhpariaTestCase.php
Expand Up @@ -37,6 +37,8 @@ abstract class PhpariaTestCase extends PHPUnit_Framework_TestCase

public function setUp()
{
parent::setUp();

$configFile = __DIR__.'/../../config.yml';
$value = Yaml::parse(file_get_contents($configFile));

Expand All @@ -54,4 +56,14 @@ public function setUp()
$this->client = new Phparia($this->logger);
$this->client->connect($this->ariAddress, $this->amiAddress);
}

public function tearDown()
{
$channels = $this->client->channels()->getChannels();
foreach ($channels as $channel) {
$channel->hangup();
}

parent::tearDown();
}
}

0 comments on commit 5941b16

Please sign in to comment.