public function testClose() { $mock = $this->getMock('\\Ratchet\\ConnectionInterface'); $conn = new WampConnection($mock); $mock->expects($this->once())->method('close'); $conn->close(); }
/** * @dataProvider eventProvider */ public function testEvent($topic, $payload) { $conn = new WampConnection($this->newConn()); $conn->event($topic, $payload); $eventString = $conn->last['send']; $this->assertSame(array(8, $topic, $payload), json_decode($eventString, true)); }
public function testGetUriWhenNoCurieGiven() { $conn = new WampConnection(new Connection()); $uri = 'http://example.com/noshort'; $this->assertEquals($uri, $conn->getUri($uri)); }