summaryrefslogtreecommitdiffstats
path: root/apps/files/tests/ajax_rename.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-11-26 00:03:54 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2013-11-26 00:03:54 +0100
commit46dff0677d3eff1aa4da94865e82698229dd71e0 (patch)
tree91b96385b6a5725592bf68169f9d862b007bf14c /apps/files/tests/ajax_rename.php
parentacf74b24f24e1c2ea9e454a1c09f6bcf404f6627 (diff)
parent5310a5924b18849c85b482819c350d72a6d0c67c (diff)
downloadnextcloud-server-46dff0677d3eff1aa4da94865e82698229dd71e0.tar.gz
nextcloud-server-46dff0677d3eff1aa4da94865e82698229dd71e0.zip
Merge branch 'master' into calc_version_size
Diffstat (limited to 'apps/files/tests/ajax_rename.php')
-rw-r--r--apps/files/tests/ajax_rename.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/files/tests/ajax_rename.php b/apps/files/tests/ajax_rename.php
index e654255c407..3735b0a49c8 100644
--- a/apps/files/tests/ajax_rename.php
+++ b/apps/files/tests/ajax_rename.php
@@ -22,9 +22,18 @@
*/
class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase {
+ private static $user;
function setUp() {
// mock OC_L10n
+ if (!self::$user) {
+ self::$user = uniqid();
+ }
+ \OC_User::createUser(self::$user, 'password');
+ \OC_User::setUserId(self::$user);
+
+ \OC\Files\Filesystem::init(self::$user, '/' . self::$user . '/files');
+
$l10nMock = $this->getMock('\OC_L10N', array('t'), array(), '', false);
$l10nMock->expects($this->any())
->method('t')
@@ -39,6 +48,12 @@ class Test_OC_Files_App_Rename extends \PHPUnit_Framework_TestCase {
$this->files = new \OCA\Files\App($viewMock, $l10nMock);
}
+ function tearDown() {
+ $result = \OC_User::deleteUser(self::$user);
+ $this->assertTrue($result);
+ \OC\Files\Filesystem::tearDown();
+ }
+
/**
* @brief test rename of file/folder named "Shared"
*/