コード例 #1
0
ファイル: Photoset.php プロジェクト: seeminglee/smldata
 function setUp()
 {
     $this->api = new Phlickr_Api(TESTING_API_KEY, TESTING_API_SECRET, TESTING_API_TOKEN);
     $this->api->setEndpointUrl('http://example.com');
     // inject the response xml into the cache...
     // ... first for the full description of the photoset
     $this->api->addResponseToCache(Phlickr_Photoset::getRequestMethodName(), Phlickr_Photoset::getRequestMethodParams(TESTING_XML_PHOTOSET_ID), TESTING_RESP_OK_PREFIX . TESTING_XML_PHOTOSET . TESTING_RESP_SUFIX);
     $this->psInteger = new Phlickr_Photoset($this->api, TESTING_XML_PHOTOSET_ID);
     $this->psXml = new Phlickr_Photoset($this->api, simplexml_load_string(TESTING_XML_PHOTOSET));
 }
コード例 #2
0
ファイル: AuthedPhotoset.php プロジェクト: seeminglee/smldata
 function setUp()
 {
     $this->api = new Phlickr_Api(TESTING_API_KEY, TESTING_API_SECRET, TESTING_API_TOKEN);
     $this->api->setEndpointUrl('http://example.com');
     // inject the response xml into the cache...
     // ... first the login details (so it can figure out the user id)
     $this->api->addResponseToCache('flickr.auth.checkToken', $this->api->getParamsForRequest(), TESTING_RESP_OK_PREFIX . TESTING_XML_CHECKTOKEN . TESTING_RESP_SUFIX);
     // ... then the full description of the photoset
     $this->api->addResponseToCache(Phlickr_Photoset::getRequestMethodName(), Phlickr_Photoset::getRequestMethodParams(TESTING_XML_PHOTOSET_ID), TESTING_RESP_OK_PREFIX . TESTING_XML_PHOTOSET . TESTING_RESP_SUFIX);
     $this->psInteger = new Phlickr_AuthedPhotoset($this->api, TESTING_XML_PHOTOSET_ID);
     $this->psXml = new Phlickr_AuthedPhotoset($this->api, simplexml_load_string(TESTING_XML_PHOTOSET));
 }
コード例 #3
0
 /**
  * Constructor.
  *
  * You can construct a photoset from an Id or XML.
  *
  * @param   object Phlickr_Api $api This object must have valid
  *          authentication information or an exception will be thrown.
  * @param   mixed $source integer Id, object SimpleXMLElement
  * @throws  Phlickr_Exception, Phlickr_ConnectionException,
  *          Phlickr_XmlParseException
  */
 function __construct(Phlickr_Api $api, $source)
 {
     assert($api->isAuthValid());
     parent::__construct($api, $source);
 }