示例#1
0
 public function testNotifiesHubAndReportsFail()
 {
     PubSubHubbub::setHttpClient($this->getClientFail());
     $client = PubSubHubbub::getHttpClient();
     $this->_publisher->addHubUrl('http://www.example.com/hub');
     $this->_publisher->addUpdatedTopicUrl('http://www.example.com/topic');
     $this->_publisher->setParameter('foo', 'bar');
     $this->_publisher->notifyAll();
     $this->assertFalse($this->_publisher->isSuccess());
 }
示例#2
0
 /**
  * Pubsubhubbub送信
  */
 protected function sendPubsubhubbub()
 {
     // Pubsubhubbub発行オブジェクトを生成
     $publisher = new Publisher();
     // Pubsubhubbubを送るサーバーをセット
     $publisher->addHubUrls(self::$pubsubhubbub_server);
     // ページをセット
     $publisher->addUpdatedTopicUrls(array($this->wiki->uri()));
     $publisher->notifyAll();
     if (!$publisher->isSuccess()) {
         // check for errors
         $errors = $publisher->getErrors();
         $failedHubs = array();
         foreach ($errors as $error) {
             $failedHubs[] = $error['hubUrl'];
         }
         return $failedHubs;
     }
     return null;
 }