示例#1
0
 /**
  * Returns the URL generated for this query, based on it's current
  * parameters.
  *
  * @return string A URL generated based on the state of this query.
  * @throws Zend_Gdata_App_InvalidArgumentException
  */
 public function getQueryUrl($incomingUri = '')
 {
     $uri = '';
     if ($this->getPhotoId() !== null) {
         $uri .= '/photoid/' . $this->getPhotoId();
     } else {
         require_once 'Zend/Gdata/App/InvalidArgumentException.php';
         throw new Zend_Gdata_App_InvalidArgumentException('PhotoId cannot be null');
     }
     $uri .= $incomingUri;
     return parent::getQueryUrl($uri);
 }
示例#2
0
 /**
  * Check the consistency of an album feed request for specifically-sized images
  */
 public function testImgAlbumQuery()
 {
     $queryString = "https://picasaweb.google.com/data/feed/api/user/sample.user/albumid/1?imgmax=800";
     $query = new Zend_Gdata_Photos_AlbumQuery();
     $query->setUser("sample.user");
     $query->setAlbumId("1");
     $query->setImgMax("800");
     // Assert that the set ImgMax is correct
     $this->assertEquals("800", $query->getImgMax());
     $generatedString = $query->getQueryUrl();
     // Assert that the generated query matches the correct one
     $this->assertEquals($queryString, $generatedString);
     // Check that ImgMax is set back to null
     $queryString = "https://picasaweb.google.com/data/feed/api/user/sample.user/albumid/1";
     $query->setImgMax(null);
     $generatedString = $query->getQueryUrl();
     // Assert that the generated query matches the correct one
     $this->assertEquals($queryString, $generatedString);
 }