/** * Ensures that getImageDetails() throws an exception given an empty argument * * @return void */ public function testGetImageDetailsExceptionIdEmpty() { $this->setExpectedException('Zend\\Service\\Flickr\\Exception\\InvalidArgumentException', 'supply a photo'); $this->flickr->getImageDetails('0'); }
/** * Parse the Flickr Result * * @param DOMElement $image * @param Flickr $flickr Original Flickr object with which the request was made */ public function __construct(DOMElement $image, 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; } }