/** * Basic testing to ensure that groupPoolGetPhotos works as expected * * @return void */ public function testGroupPoolGetPhotosBasic() { $options = array('per_page' => 10, 'page' => 1, 'extras' => 'license, date_upload, date_taken, owner_name, icon_server'); $resultSet = $this->flickr->groupPoolGetPhotos('20083316@N00', $options); $this->assertGreaterThan(20000, $resultSet->totalResultsAvailable); $this->assertEquals(10, $resultSet->totalResults()); $this->assertEquals(10, $resultSet->totalResultsReturned); $this->assertEquals(1, $resultSet->firstResultPosition); $this->assertEquals(0, $resultSet->key()); try { $resultSet->seek(-1); $this->fail('Expected OutOfBoundsException not thrown'); } catch (OutOfBoundsException $e) { $this->assertContains('Illegal index', $e->getMessage()); } $resultSet->seek(9); try { $resultSet->seek(10); $this->fail('Expected OutOfBoundsException not thrown'); } catch (OutOfBoundsException $e) { $this->assertContains('Illegal index', $e->getMessage()); } $resultSet->rewind(); $count = 0; foreach ($resultSet as $result) { $this->assertInstanceOf('Zend\\Service\\Flickr\\Result', $result); $count++; } $this->assertEquals(10, $count); }
/** * Ensures that groupPoolGetPhotos() throws an exception when an array is given for group_id * * @return void */ public function testGroupPoolGetPhotosExceptionGroupIdArray() { $this->setExpectedException('Zend\\Service\\Flickr\\Exception\\InvalidArgumentException', 'supply a group'); $this->flickr->groupPoolGetPhotos(array()); }