Exemplo n.º 1
0
 function testUpload_WithMeta()
 {
     $user = new Phlickr_User($this->api, $this->api->getUserId());
     $oldPhotoCount = $user->getPhotoCount();
     $this->uploader->setPerms(true, false, false);
     // upload it
     $result = $this->uploader->Upload(TESTING_FILE_NAME_JPG, 'testing title', 'a description', 'atag btag');
     // ensure the photo count increases
     $user->refresh();
     $this->assertEquals($oldPhotoCount + 1, $user->getPhotoCount(), 'Photocount should have increased.');
     // verify the returned id
     $this->assertType('string', $result, 'Returned the wrong type.');
     $photo = new Phlickr_Photo($this->api, $result);
     $this->assertNotNull($photo, "Couldn't load a photo from the result id.");
     $this->assertEquals('testing title', $photo->getTitle());
     $this->assertEquals('a description', $photo->getDescription());
     $this->assertEquals(array('atag', 'btag'), $photo->getTags());
     $this->assertTrue($photo->isForPublic());
     $this->assertFalse($photo->isForFriends());
     $this->assertFalse($photo->isForFamily());
 }