diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2015-01-14 21:06:26 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-01-19 09:16:15 +0100 |
commit | 15ae6b47edf08a1fd60a0941c3786372afad5baa (patch) | |
tree | 114df784b78a1a87b352082271f4dd8baeb22844 /apps/files_sharing/tests | |
parent | 4fcfedb03cb60fe60617fd8d7609d5d1397789a5 (diff) | |
download | nextcloud-server-15ae6b47edf08a1fd60a0941c3786372afad5baa.tar.gz nextcloud-server-15ae6b47edf08a1fd60a0941c3786372afad5baa.zip |
replace hook with storage wrapper
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r-- | apps/files_sharing/tests/share.php | 1 | ||||
-rw-r--r-- | apps/files_sharing/tests/sharedmount.php | 1 | ||||
-rw-r--r-- | apps/files_sharing/tests/sharedstorage.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/updater.php | 12 |
4 files changed, 9 insertions, 7 deletions
diff --git a/apps/files_sharing/tests/share.php b/apps/files_sharing/tests/share.php index b8c8b70bd1f..9ae2e330649 100644 --- a/apps/files_sharing/tests/share.php +++ b/apps/files_sharing/tests/share.php @@ -50,6 +50,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { } protected function tearDown() { + self::loginHelper(self::TEST_FILES_SHARING_API_USER1); $this->view->unlink($this->filename); $this->view->deleteAll($this->folder); diff --git a/apps/files_sharing/tests/sharedmount.php b/apps/files_sharing/tests/sharedmount.php index dd66ca05d38..715c22cf4ae 100644 --- a/apps/files_sharing/tests/sharedmount.php +++ b/apps/files_sharing/tests/sharedmount.php @@ -186,6 +186,7 @@ class Test_Files_Sharing_Mount extends OCA\Files_sharing\Tests\TestCase { $this->assertFalse(\OC\Files\Filesystem::file_exists("newFileName")); //cleanup + self::loginHelper(self::TEST_FILES_SHARING_API_USER1); \OCP\Share::unshare('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_GROUP, 'testGroup'); \OC_Group::removeFromGroup(self::TEST_FILES_SHARING_API_USER1, 'testGroup'); \OC_Group::removeFromGroup(self::TEST_FILES_SHARING_API_USER2, 'testGroup'); diff --git a/apps/files_sharing/tests/sharedstorage.php b/apps/files_sharing/tests/sharedstorage.php index 75373244508..7ab1564bc3d 100644 --- a/apps/files_sharing/tests/sharedstorage.php +++ b/apps/files_sharing/tests/sharedstorage.php @@ -29,7 +29,7 @@ class Test_Files_Sharing_Storage extends OCA\Files_sharing\Tests\TestCase { protected function setUp() { parent::setUp(); - + \OCA\Files_Trashbin\Trashbin::registerHooks(); $this->folder = '/folder_share_storage_test'; $this->filename = '/share-api-storage.txt'; diff --git a/apps/files_sharing/tests/updater.php b/apps/files_sharing/tests/updater.php index bc8deaf19b0..1d6ec8caa61 100644 --- a/apps/files_sharing/tests/updater.php +++ b/apps/files_sharing/tests/updater.php @@ -98,12 +98,12 @@ class Test_Files_Sharing_Updater extends OCA\Files_sharing\Tests\TestCase { // trashbin should contain the local file but not the mount point $rootView = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER2); - $dirContent = $rootView->getDirectoryContent('files_trashbin/files'); - $this->assertSame(1, count($dirContent)); - $firstElement = reset($dirContent); - $ext = pathinfo($firstElement['path'], PATHINFO_EXTENSION); - $this->assertTrue($rootView->file_exists('files_trashbin/files/localFolder.' . $ext . '/localFile.txt')); - $this->assertFalse($rootView->file_exists('files_trashbin/files/localFolder.' . $ext . '/' . $this->folder)); + $trashContent = \OCA\Files_Trashbin\Helper::getTrashFiles('/', self::TEST_FILES_SHARING_API_USER2); + $this->assertSame(1, count($trashContent)); + $firstElement = reset($trashContent); + $timestamp = $firstElement['mtime']; + $this->assertTrue($rootView->file_exists('files_trashbin/files/localFolder.d' . $timestamp . '/localFile.txt')); + $this->assertFalse($rootView->file_exists('files_trashbin/files/localFolder.d' . $timestamp . '/' . $this->folder)); //cleanup $rootView->deleteAll('files_trashin'); |