Skip to content

Commit

Permalink
AriClient onClose test added
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Smith committed Feb 9, 2016
1 parent f74d411 commit ccbd054
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/wormling/phparia/Tests/Functional/Api/AriClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,26 @@ public function canCallOnRequest()
$this->client->run();
$this->assertTrue($success);
}

/**
* @test
*/
public function canCallOnClose()
{
$success = false;
$this->client->onStasisStart(function (StasisStart $event) {
$event->getChannel()->answer();
$this->client->stop();
});
$this->client->getAriClient()->onClose(function () use (&$success) {
$success = true;
});
$this->client->getAriClient()->onConnect(function () {
$this->client->channels()->createChannel($this->dialString, null, null, null, null,
$this->client->getStasisApplicationName());
});
$this->client->run();
$this->assertTrue($success);
}
}
}

0 comments on commit ccbd054

Please sign in to comment.