public function delete() { parent::delete(); $oDirectory = $this->getDirectory(); $oDirectory->updateQuota(); }
/** * Constructor * * @param string $path on-disk path. * @param array $acl ACL rules. * @param string|null $owner principal owner string. */ function __construct($path, array $acl, $owner = null) { parent::__construct($path); $this->acl = $acl; $this->owner = $owner; }
/** * @depends testUpdatePropertiesMove */ function testUpdatePropertiesDeleteBleed() { $file = new File(SABRE_TEMPDIR . '/dir/file.txt'); $mutations = array('{http://sabredav.org/NS/2010}test1' => 'foo', '{http://sabredav.org/NS/2010}test2' => 'bar'); $propPatch = new PropPatch($mutations); $file->propPatch($propPatch); $result = $propPatch->commit(); $this->assertEquals(true, $result); $properties = $file->getProperties(array('{http://sabredav.org/NS/2010}test1', '{http://sabredav.org/NS/2010}test2', '{http://sabredav.org/NS/2010}test3')); $this->assertEquals(array('{http://sabredav.org/NS/2010}test1' => 'foo', '{http://sabredav.org/NS/2010}test2' => 'bar'), $properties); // Deleting $file->delete(); $this->assertFalse(file_exists(SABRE_TEMPDIR . '/dir/file.txt')); // Creating it again file_put_contents(SABRE_TEMPDIR . '/dir/file.txt', 'New Contents'); $file = new File(SABRE_TEMPDIR . '/dir/file.txt'); $properties = $file->getProperties(array('http://sabredav.org/NS/2010}test1', '{http://sabredav.org/NS/2010}test2', '{http://sabredav.org/NS/2010}test3')); $this->assertEquals(array(), $properties); }
public function delete() { parent::delete(); $this->deleteResourceData(); $this->getDirectory()->updateQuota(); }
function testGetSize() { $file = new File(SABRE_TEMPDIR . '/file.txt'); $this->assertEquals(8, $file->getSize()); }