/**
  * Checks updatePermissions() - verifies that this method actually sets Permissions for a resource
  * different than folder (in this case, an image).
  */
 public function testPostPermissionsToResource_addsPermissionCorrectly()
 {
     $this->jc->putResource('/', $this->test_folder);
     $resource = JasperTestUtils::createImage($this->test_folder);
     $this->jc->putResource('', $resource, dirname(__FILE__) . '/resources/pitbull.jpg');
     $resource = $this->jc->getResource($resource->getUriString());
     $joeuser = $this->jc->getUsers('joeuser');
     $perms = $this->jc->getPermissions($resource->getUriString());
     $perm = new Permission('32', $joeuser[0], $resource->getUriString());
     $perms[] = $perm;
     $this->jc->updatePermissions($resource->getUriString(), $perms);
     $updated_perms = $this->jc->getPermissions($resource->getUriString());
     $this->jc->deleteResource($this->test_folder->getUriString());
     $this->assertEquals(sizeof($perms), sizeof($updated_perms));
     $this->assertEquals($perm->getPermissionMask(), $updated_perms[count($updated_perms) - 1]->getPermissionMask());
     $this->assertEquals($perm->getPermissionRecipient(), $updated_perms[count($updated_perms) - 1]->getPermissionRecipient());
 }