/** * Ensures that getImageDetails() throws an exception given an empty argument * * @return void */ public function testGetImageDetailsExceptionIdEmpty() { try { $this->_flickr->getImageDetails('0'); $this->fail('Expected Zend_Service_Exception not thrown'); } catch (Zend_Service_Exception $e) { $this->assertContains('supply a photo ID', $e->getMessage()); } }
/** * Parse the Flickr Result * * @param DOMElement $image * @param Zend_Service_Flickr $flickr Original Zend_Service_Flickr object with which the request was made * @return void */ public function __construct(DOMElement $image, Zend_Service_Flickr $flickr) { $xpath = new DOMXPath($image->ownerDocument); foreach ($xpath->query('./@*', $image) as $property) { $this->{$property->name} = (string) $property->value; } $this->_flickr = $flickr; foreach ($this->_flickr->getImageDetails($this->id) as $k => $v) { $this->{$k} = $v; } }
/** * Parse the Flickr Result * * @param DomElement $image * @param Zend_Service_Flickr $flickr Original Zend_Service_Flickr object with which the request was made */ function __construct(DomElement $image, Zend_Service_Flickr $flickr) { $xpath = new DOMXPath($image->ownerDocument); $photo_properties = array('id', 'owner', 'secret', 'server', 'title', 'ispublic', 'isfriend', 'isfamily', 'license', 'date_upload', 'date_taken', 'owner_name', 'icon_server'); foreach ($xpath->query('./@*', $image) as $property) { $this->{$property->name} = (string) $property->value; } $this->_flickr = $flickr; foreach ($this->_flickr->getImageDetails($this->id) as $k => $v) { $this->{$k} = $v; } }