self::loginHelper(self::TEST_FILES_SHARING_API_USER2);
- \OC\Files\Filesystem::rename($this->filename, "newFileName");
+ \OC\Files\Filesystem::rename($this->filename, $this->filename . '_renamed');
- $this->assertTrue(\OC\Files\Filesystem::file_exists('newFileName'));
+ $this->assertTrue(\OC\Files\Filesystem::file_exists($this->filename . '_renamed'));
$this->assertFalse(\OC\Files\Filesystem::file_exists($this->filename));
self::loginHelper(self::TEST_FILES_SHARING_API_USER1);
$this->assertTrue(\OC\Files\Filesystem::file_exists($this->filename));
- $this->assertFalse(\OC\Files\Filesystem::file_exists("newFileName"));
+ $this->assertFalse(\OC\Files\Filesystem::file_exists($this->filename . '_renamed'));
+
+ // rename back to original name
+ self::loginHelper(self::TEST_FILES_SHARING_API_USER2);
+ \OC\Files\Filesystem::rename($this->filename . '_renamed', $this->filename);
+ $this->assertFalse(\OC\Files\Filesystem::file_exists($this->filename . '_renamed'));
+ $this->assertTrue(\OC\Files\Filesystem::file_exists($this->filename));
//cleanup
\OCP\Share::unshare('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2);
}
/**
+ * Sets the mount point path, relative to data/
+ *
* @param string $mountPoint new mount point
*/
public function setMountPoint($mountPoint) {
- $this->mountPoint = $mountPoint;
+ $this->mountPoint = $this->formatPath($mountPoint);
}
/**
$this->assertEquals($storage, $mountPoint->getStorage());
$this->assertEquals(123, $mountPoint->getStorageId());
+ $this->assertEquals('/mountpoint/', $mountPoint->getMountPoint());
+
+ $mountPoint->setMountPoint('another');
+ $this->assertEquals('/another/', $mountPoint->getMountPoint());
}
public function testInvalidStorage() {