Beispiel #1
0
 public function getQueryUrl($incomingUri = '')
 {
     $uri = '';
     if ($this->getAlbumName() !== null && $this->getAlbumId() === null) {
         $uri .= '/album/' . $this->getAlbumName();
     } elseif ($this->getAlbumName() === null && $this->getAlbumId() !== null) {
         $uri .= '/albumid/' . $this->getAlbumId();
     } elseif ($this->getAlbumName() !== null && $this->getAlbumId() !== null) {
         require_once 'Zend/Gdata/App/InvalidArgumentException.php';
         throw new Zend_Gdata_App_InvalidArgumentException('AlbumName and AlbumId cannot both be non-null');
     } else {
         require_once 'Zend/Gdata/App/InvalidArgumentException.php';
         throw new Zend_Gdata_App_InvalidArgumentException('AlbumName and AlbumId cannot both be null');
     }
     $uri .= $incomingUri;
     return parent::getQueryUrl($uri);
 }
 /**
  * Check the consistency of a user feed request for private data
  */
 public function testPrivateUserQuery()
 {
     $queryString = "http://picasaweb.google.com/data/feed/api/user/sample.user?access=private";
     $query = new Zend_Gdata_Photos_UserQuery();
     $query->setUser("sample.user");
     $query->setAccess("private");
     $generatedString = $query->getQueryUrl();
     // Assert that the generated query matches the correct one
     $this->assertEquals($queryString, $generatedString);
 }