コード例 #1
0
 /**
  * Test setter/getter method for renewed token flag.
  * @covers \BogCon\YahooMessengerApi\Client::setTokenRenewed
  * @covers \BogCon\YahooMessengerApi\Client::isTokenRenewed
  */
 public function testSetIsTokenRenewed()
 {
     $objYM = new Client('vxc123ads', 'das_+DAS', 'appKey', 'appSecret');
     $this->assertFalse($objYM->isTokenRenewed());
     $objYM->setTokenRenewed(true);
     $this->assertTrue($objYM->isTokenRenewed());
     $objYM->setTokenRenewed(false);
     $this->assertFalse(false, $objYM->isTokenRenewed());
     $objYM->setTokenRenewed(0);
     $this->assertFalse($objYM->isTokenRenewed());
     $objYM->setTokenRenewed('trueeee');
     $this->assertTrue($objYM->isTokenRenewed());
 }
コード例 #2
0
ファイル: ajax.php プロジェクト: realreef/webym
                 }
             } catch (Exception $objEx) {
                 $arrReturnValue['response'] = 'Could not get user avatar.';
                 Logger::log($objEx->getMessage());
             }
         }
     }
     break;
     /* GET NOTIFICATIONS */
 /* GET NOTIFICATIONS */
 case 'get_notifications':
     if (!checkLocalLogin()) {
         $arrReturnValue['response'] = 'You must be logged in order to retrieve notifications.';
     } else {
         try {
             $objYM = new Client($_SESSION['username'], $_SESSION['pwd'], APP_CONSUMER_KEY, APP_CONSUMER_SECRET);
             $objYM->setTokens($_SESSION['ym_tokens']);
             $objYM->setSession($_SESSION['ym_session']);
             $notifications = $objYM->fetchNotifications($_SESSION['ym_notifications_seq']);
             Logger::log(var_export($notifications, 1));
             $arrAjaxResponse = array();
             foreach ($notifications['responses'] as $notificationsResponse) {
                 foreach ($notificationsResponse as $notificationType => $notif) {
                     switch ($notificationType) {
                         case 'logOff':
                             $arrAjaxResponse[] = array('type' => $notificationType, 'info' => array('buddy' => htmlspecialchars($notif['buddy'])));
                             break;
                         case 'buddyInfo':
                             foreach ($notif['contact'] as $notifContact) {
                                 $info = array('buddy' => htmlspecialchars($notifContact['sender']), 'network' => isset($notifContact['network']) ? $notifContact['network'] : 'yahoo', 'presenceMessage' => '', 'presenceState' => '');
                                 if (isset($notifContact['customDNDStatus'])) {