コード例 #1
0
 function testCreate_WithValidInfo()
 {
     // verify that we can create
     $count = $this->psl->getCount();
     if ($count > 2) {
         $this->deleteExtraSets();
     }
     // create it
     $result = $this->psl->create('test creation', 'delete me!', TESTING_REAL_PHOTO_ID_JPG);
     $this->assertType('string', $result, 'Returned the wrong type.');
     sleep(3);
     // instantiate the object and check it out
     $ps = new Phlickr_AuthedPhotoset($this->api, $result);
     $this->assertNotNull($ps->getId(), 'Id was not set');
     $this->assertEquals(TESTING_REAL_PHOTO_ID_JPG, $ps->getPrimaryId(), 'Primary photo was not set.');
     $this->assertEquals('test creation', $ps->getTitle());
     $this->assertEquals('delete me!', $ps->getDescription());
     $this->assertEquals($count + 1, $this->psl->getCount(), 'number of photosets did not increase');
     // clean it up
     $this->psl->delete($result);
 }
コード例 #2
0
 /**
  * @uses    Phlickr_AuthedPhotoset::buildUrl() to provide the user with a
  *          URL to edit the photo set.
  */
 public function afterCreatePhotoset(Phlickr_AuthedPhotoset $set)
 {
     $this->_write("Created a photoset named '{$set->getTitle()}':\n");
     $this->_write($set->buildUrl() . "\n");
 }