/** * @dataProvider topicConnExpectationProvider */ public function testTopicRetentionFromLeavingConnections($autoDelete, $methodCall, $expectation) { $topicName = 'checkTopic'; list($topic, $attribute) = $this->topicProvider($topicName); $topic->autoDelete = $autoDelete; $this->mngr->onSubscribe($this->conn, $topicName); call_user_func_array(array($this->mngr, $methodCall), array($this->conn, $topicName)); $this->assertCount($expectation, $attribute->getValue($this->mngr)); }
public function testConnIsRemovedFromTopicOnClose() { $name = 'State testing'; $class = new \ReflectionClass('Ratchet\\Wamp\\TopicManager'); $method = $class->getMethod('getTopic'); $method->setAccessible(true); $topic = $method->invokeArgs($this->mngr, array($name)); $this->mngr->onSubscribe($this->conn, $name); $this->mngr->onClose($this->conn); $this->assertFalse($topic->has($this->conn)); }