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.');
 }
 /**
  * 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');
 }