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 photosetlist description, this user $this->api->addResponseToCache(Phlickr_PhotosetList::getRequestMethodName(), Phlickr_PhotosetList::getRequestMethodParams(TESTING_USER_ID), TESTING_RESP_OK_PREFIX . TESTING_XML_PHOTOSETS . TESTING_RESP_SUFIX); // ... then the full photosetlist description, other user $this->api->addResponseToCache(Phlickr_PhotosetList::getRequestMethodName(), Phlickr_PhotosetList::getRequestMethodParams(TESTING_OTHER_USER_ID), TESTING_RESP_OK_PREFIX . TESTING_XML_PHOTOSETS . TESTING_RESP_SUFIX); $this->pslUserFromApi = new Phlickr_PhotosetList($this->api); $this->pslSpecifiedUser = new Phlickr_PhotosetList($this->api, TESTING_OTHER_USER_ID); }
/** * Constructor. * * @param object Phlickr_Api $api This object must have valid * authentication information or an exception will be thrown. */ function __construct(Phlickr_Api $api) { parent::__construct($api, $api->getUserId()); }