getNodeForPath('file.txt'); $this->assertTrue($node instanceof Sabre_DAV_FS_File); } function testGetNodeForPath_Directory() { $fs = new Sabre_DAV_Tree_Filesystem(SABRE_TEMPDIR); $node = $fs->getNodeForPath('dir'); $this->assertTrue($node instanceof Sabre_DAV_FS_Directory); } function testCopy() { $fs = new Sabre_DAV_Tree_Filesystem(SABRE_TEMPDIR); $fs->copy('file.txt','file2.txt'); $this->assertTrue(file_exists(SABRE_TEMPDIR . '/file2.txt')); $this->assertEquals('Body',file_get_contents(SABRE_TEMPDIR . '/file2.txt')); } function testCopyDir() { $fs = new Sabre_DAV_Tree_Filesystem(SABRE_TEMPDIR); $fs->copy('dir','dir2'); $this->assertTrue(file_exists(SABRE_TEMPDIR . '/dir2')); $this->assertEquals('Body',file_get_contents(SABRE_TEMPDIR . '/dir2/subfile.txt')); } function testMove() { $fs = new Sabre_DAV_Tree_Filesystem(SABRE_TEMPDIR); $fs->move('file.txt','file2.txt'); $this->assertTrue(file_exists(SABRE_TEMPDIR . '/file2.txt')); $this->assertTrue(!file_exists(SABRE_TEMPDIR . '/file.txt')); $this->assertEquals('Body',file_get_contents(SABRE_TEMPDIR . '/file2.txt')); } }