コード例 #1
0
 public function testSessionStartRegistered()
 {
     $xmpp = new SuperfeedrXmpp('superfeedr.com', 5222, 'user', 'pass');
     $this->assertFalse($xmpp->isSessionStarted(), 'Session marked as started prior to start event.');
     $xmpp->event('session_start');
     $this->assertTrue($xmpp->isSessionStarted(), 'Session not marked as started after start event.');
 }
コード例 #2
0
 /**
  * Handle a response to a subscription request from our connection, and set
  * our success state appropriately.
  * @param \XMPPHP_XMLObj $response The server's response to a subscription
  * request.
  */
 public function handleResponse(\XMPPHP_XMLObj $response)
 {
     if ($response->attrs['type'] == 'result') {
         $this->successful = true;
     } else {
         $this->successful = false;
     }
     $this->xmpp->event('handle_subscription');
 }