From 176fba83eae36f39b987d1076fbad72be901add0 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 24 Mar 2015 10:19:54 +0100 Subject: Setup the filesystem in the expire command --- apps/files_versions/tests/versions.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'apps/files_versions/tests') diff --git a/apps/files_versions/tests/versions.php b/apps/files_versions/tests/versions.php index cf0ffb320e2..3690057355e 100644 --- a/apps/files_versions/tests/versions.php +++ b/apps/files_versions/tests/versions.php @@ -243,6 +243,8 @@ class Test_Files_Versioning extends \Test\TestCase { // execute rename hook of versions app \OC\Files\Filesystem::rename("test.txt", "test2.txt"); + $this->runCommands(); + $this->assertFalse($this->rootView->file_exists($v1)); $this->assertFalse($this->rootView->file_exists($v2)); @@ -285,8 +287,11 @@ class Test_Files_Versioning extends \Test\TestCase { // execute rename hook of versions app \OC\Files\Filesystem::rename('/folder1/test.txt', '/folder1/folder2/test.txt'); + self::loginHelper(self::TEST_VERSIONS_USER2); + $this->runCommands(); + $this->assertFalse($this->rootView->file_exists($v1)); $this->assertFalse($this->rootView->file_exists($v2)); @@ -330,6 +335,8 @@ class Test_Files_Versioning extends \Test\TestCase { self::loginHelper(self::TEST_VERSIONS_USER); + $this->runCommands(); + $this->assertTrue($this->rootView->file_exists($v1)); $this->assertTrue($this->rootView->file_exists($v2)); @@ -361,6 +368,8 @@ class Test_Files_Versioning extends \Test\TestCase { // execute copy hook of versions app \OC\Files\Filesystem::copy("test.txt", "test2.txt"); + $this->runCommands(); + $this->assertTrue($this->rootView->file_exists($v1)); $this->assertTrue($this->rootView->file_exists($v2)); @@ -414,7 +423,9 @@ class Test_Files_Versioning extends \Test\TestCase { public static function loginHelper($user, $create = false) { if ($create) { - \OC_User::createUser($user, $user); + $backend = new \OC_User_Dummy(); + $backend->createUser($user, $user); + \OC::$server->getUserManager()->registerBackend($backend); } \OC_Util::tearDownFS(); -- cgit v1.2.3