diff options
Diffstat (limited to 'apps/files/tests/ajax_rename.php')
-rw-r--r-- | apps/files/tests/ajax_rename.php | 15 |
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" */ |