/** * @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); }
function testGetSize() { $file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt'); $this->assertEquals(8, $file->getSize()); }
/** * @depends testLock */ function testMultipleFilesInDir() { $file1 = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/dir/file.txt'); $lockInfo = new Sabre_DAV_Locks_LockInfo(); $lockInfo->owner = 'me'; $lockInfo->token = 'SOMERANDOMSTRING'; $file1->lock($lockInfo); // What we're testing is, to make sure that changing resourcedata // from one file does not mess with resourcedata from another $file2 = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/dir/file2.txt'); $result = $file2->getLocks(); $this->assertEquals(array(), $result); }