From 15ae6b47edf08a1fd60a0941c3786372afad5baa Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 14 Jan 2015 21:06:26 +0100 Subject: replace hook with storage wrapper --- apps/files_sharing/tests/share.php | 1 + apps/files_sharing/tests/sharedmount.php | 1 + apps/files_sharing/tests/sharedstorage.php | 2 +- apps/files_sharing/tests/updater.php | 12 ++++++------ 4 files changed, 9 insertions(+), 7 deletions(-) (limited to 'apps/files_sharing/tests') 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'); -- cgit v1.2.3