From 6ee81074d3fe886a450141b06f6e271f85f0e277 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Sun, 22 Jul 2012 17:55:53 -0400 Subject: [PATCH] [WAMP][BCB] Property name change Changed $conn->WAMP->topics to $conn->WAMP->subscriptions --- src/Ratchet/Wamp/TopicManager.php | 10 +++++----- tests/Ratchet/Tests/Wamp/TopicManagerTest.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Ratchet/Wamp/TopicManager.php b/src/Ratchet/Wamp/TopicManager.php index bea1171..b019371 100644 --- a/src/Ratchet/Wamp/TopicManager.php +++ b/src/Ratchet/Wamp/TopicManager.php @@ -22,7 +22,7 @@ class TopicManager implements WsServerInterface, WampServerInterface { * {@inheritdoc} */ public function onOpen(ConnectionInterface $conn) { - $conn->WAMP->topics = new \SplObjectStorage; + $conn->WAMP->subscriptions = new \SplObjectStorage; $this->app->onOpen($conn); } @@ -39,12 +39,12 @@ class TopicManager implements WsServerInterface, WampServerInterface { public function onSubscribe(ConnectionInterface $conn, $topic) { $topicObj = $this->getTopic($topic); - if ($conn->WAMP->topics->contains($topicObj)) { + if ($conn->WAMP->subscriptions->contains($topicObj)) { return; } $this->topicLookup[$topic]->add($conn); - $conn->WAMP->topics->attach($topicObj); + $conn->WAMP->subscriptions->attach($topicObj); $this->app->onSubscribe($conn, $topicObj); } @@ -54,8 +54,8 @@ class TopicManager implements WsServerInterface, WampServerInterface { public function onUnsubscribe(ConnectionInterface $conn, $topic) { $topicObj = $this->getTopic($topic); - if ($conn->WAMP->topics->contains($topicObj)) { - $conn->WAMP->topics->detach($topicObj); + if ($conn->WAMP->subscriptions->contains($topicObj)) { + $conn->WAMP->subscriptions->detach($topicObj); } else { return; } diff --git a/tests/Ratchet/Tests/Wamp/TopicManagerTest.php b/tests/Ratchet/Tests/Wamp/TopicManagerTest.php index af2671f..0a6655b 100644 --- a/tests/Ratchet/Tests/Wamp/TopicManagerTest.php +++ b/tests/Ratchet/Tests/Wamp/TopicManagerTest.php @@ -89,7 +89,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase { $this->mngr->onSubscribe($this->conn, $name); - $this->assertTrue($this->conn->WAMP->topics->contains($topic)); + $this->assertTrue($this->conn->WAMP->subscriptions->contains($topic)); } public function testDoubleSubscriptionFiresOnce() { @@ -130,7 +130,7 @@ class TopicManagerTest extends \PHPUnit_Framework_TestCase { $this->mngr->onSubscribe($this->conn, $name); $this->mngr->onUnsubscribe($this->conn, $name); - $this->assertFalse($this->conn->WAMP->topics->contains($topic)); + $this->assertFalse($this->conn->WAMP->subscriptions->contains($topic)); } public function testOnPublishBubbles() {