Esempio n. 1
0
 public function testCallShouldInvokeCallbackWithSuppliedArguments()
 {
     $handle = new Horde_PubSub_Handle('foo', $this, 'handleCall');
     $args = array('foo', 'bar', 'baz');
     $handle->call($args);
     $this->assertSame($args, $this->args);
 }
Esempio n. 2
0
 /**
  * Unsubscribe a handler from a topic
  *
  * @param  Horde_PubSub_Handle $handle
  * @return bool Returns true if topic and handle found, and unsubscribed; returns false if either topic or handle not found
  */
 public function unsubscribe(Horde_PubSub_Handle $handle)
 {
     $topic = $handle->getTopic();
     if (empty($this->_topics[$topic])) {
         return false;
     }
     if (false === ($index = array_search($handle, $this->_topics[$topic]))) {
         return false;
     }
     unset($this->_topics[$topic][$index]);
     return true;
 }