Skip to content

Commit

Permalink
Added getConnections test
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed Feb 2, 2014
1 parent 57130fa commit 906d5d8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Test/Case/Lib/Wamp/CakeWampAppConnectionTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@

class CakeWampAppConnectionTraitTest extends CakeRatchetTestCase {

public function testGetConnections() {
$mock = $this->getMock('\\Ratchet\\ConnectionInterface');
$conn = new Ratchet\Wamp\WampConnection($mock);
$conn->Session = new SessionHandlerImposer();

$this->assertEquals($this->AppServer->getConnections(), []);

$this->AppServer->onOpen($conn);

$this->assertEquals($this->AppServer->getConnections(), [
$conn->WAMP->sessionId => [
'topics' => [],
'session' => $conn->Session->all(),
],
]);
}

public function testOnOpen() {
$mock = $this->getMock('\\Ratchet\\ConnectionInterface');
$conn = new Ratchet\Wamp\WampConnection($mock);
Expand Down

0 comments on commit 906d5d8

Please sign in to comment.