function testDelete() { $file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt'); $file->delete(); $this->assertFalse(file_exists(SABRE_TEMPDIR . '/file.txt')); }
/** * @depends testUpdatePropertiesMove */ function testUpdatePropertiesDeleteBleed() { $file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/dir/file.txt'); $mutations = array('{http://sabredav.org/NS/2010}test1' => 'foo', '{http://sabredav.org/NS/2010}test2' => 'bar'); $result = $file->updateProperties($mutations); $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 Sabre_DAV_FSExt_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); }