diff options
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/Updater.php | 6 | ||||
-rw-r--r-- | apps/files_sharing/tests/ApiTest.php | 50 | ||||
-rw-r--r-- | apps/files_sharing/tests/CacheTest.php | 12 | ||||
-rw-r--r-- | apps/files_sharing/tests/ExternalStorageTest.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/PermissionsTest.php | 4 | ||||
-rw-r--r-- | apps/files_sharing/tests/WatcherTest.php | 6 |
6 files changed, 40 insertions, 40 deletions
diff --git a/apps/files_sharing/lib/Updater.php b/apps/files_sharing/lib/Updater.php index 828453be765..1e290e28f77 100644 --- a/apps/files_sharing/lib/Updater.php +++ b/apps/files_sharing/lib/Updater.php @@ -31,7 +31,7 @@ class Updater { /** * @param array $params */ - static public function renameHook($params) { + public static function renameHook($params) { self::renameChildren($params['oldpath'], $params['newpath']); self::moveShareToShare($params['newpath']); } @@ -46,7 +46,7 @@ class Updater { * * @param string $path */ - static private function moveShareToShare($path) { + private static function moveShareToShare($path) { $userFolder = \OC::$server->getUserFolder(); // If the user folder can't be constructed (e.g. link share) just return. @@ -90,7 +90,7 @@ class Updater { * @param string $oldPath old path relative to data/user/files * @param string $newPath new path relative to data/user/files */ - static private function renameChildren($oldPath, $newPath) { + private static function renameChildren($oldPath, $newPath) { $absNewPath = \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files/' . $newPath); $absOldPath = \OC\Files\Filesystem::normalizePath('/' . \OCP\User::getUser() . '/files/' . $oldPath); diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php index 2d262a0104a..bb478044a2f 100644 --- a/apps/files_sharing/tests/ApiTest.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -130,7 +130,7 @@ class ApiTest extends TestCase { ); } - function testCreateShareUserFile() { + public function testCreateShareUserFile() { $this->setUp(); // for some reasons phpunit refuses to do this for us only for this test $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $result = $ocs->createShare($this->filename, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2); @@ -148,7 +148,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); } - function testCreateShareUserFolder() { + public function testCreateShareUserFolder() { $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $result = $ocs->createShare($this->folder, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2); $ocs->cleanup(); @@ -165,7 +165,7 @@ class ApiTest extends TestCase { } - function testCreateShareGroupFile() { + public function testCreateShareGroupFile() { $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $result = $ocs->createShare($this->filename, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_GROUP, self::TEST_FILES_SHARING_API_GROUP1); $ocs->cleanup(); @@ -181,7 +181,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); } - function testCreateShareGroupFolder() { + public function testCreateShareGroupFolder() { $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $result = $ocs->createShare($this->folder, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_GROUP, self::TEST_FILES_SHARING_API_GROUP1); $ocs->cleanup(); @@ -245,7 +245,7 @@ class ApiTest extends TestCase { $ocs->cleanup(); } - function testEnforceLinkPassword() { + public function testEnforceLinkPassword() { $password = md5(time()); $config = \OC::$server->getConfig(); $config->setAppValue('core', 'shareapi_enforce_links_password', 'yes'); @@ -299,7 +299,7 @@ class ApiTest extends TestCase { /** * @medium */ - function testSharePermissions() { + public function testSharePermissions() { // sharing file to a user should work if shareapi_exclude_groups is set // to no \OC::$server->getConfig()->setAppValue('core', 'shareapi_exclude_groups', 'no'); @@ -350,7 +350,7 @@ class ApiTest extends TestCase { /** * @medium */ - function testGetAllShares() { + public function testGetAllShares() { $node = $this->userFolder->get($this->filename); $share = $this->shareManager->newShare(); @@ -371,7 +371,7 @@ class ApiTest extends TestCase { $this->shareManager->deleteShare($share); } - function testGetAllSharesWithMe() { + public function testGetAllSharesWithMe() { $node1 = $this->userFolder->get($this->filename); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -407,7 +407,7 @@ class ApiTest extends TestCase { /** * @medium */ - function testPublicLinkUrl() { + public function testPublicLinkUrl() { $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER1); $result = $ocs->createShare($this->folder, \OCP\Constants::PERMISSION_ALL, \OCP\Share::SHARE_TYPE_LINK); $ocs->cleanup(); @@ -456,7 +456,7 @@ class ApiTest extends TestCase { * @depends testCreateShareUserFile * @depends testCreateShareLink */ - function testGetShareFromSource() { + public function testGetShareFromSource() { $node = $this->userFolder->get($this->filename); $share = $this->shareManager->newShare(); $share->setNode($node) @@ -489,7 +489,7 @@ class ApiTest extends TestCase { * @depends testCreateShareUserFile * @depends testCreateShareLink */ - function testGetShareFromSourceWithReshares() { + public function testGetShareFromSourceWithReshares() { $node = $this->userFolder->get($this->filename); $share1 = $this->shareManager->newShare(); $share1->setNode($node) @@ -530,7 +530,7 @@ class ApiTest extends TestCase { * @medium * @depends testCreateShareUserFile */ - function testGetShareFromId() { + public function testGetShareFromId() { $node = $this->userFolder->get($this->filename); $share1 = $this->shareManager->newShare(); $share1->setNode($node) @@ -554,7 +554,7 @@ class ApiTest extends TestCase { /** * @medium */ - function testGetShareFromFolder() { + public function testGetShareFromFolder() { $node1 = $this->userFolder->get($this->filename); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -584,7 +584,7 @@ class ApiTest extends TestCase { $this->shareManager->deleteShare($share2); } - function testGetShareFromFolderWithFile() { + public function testGetShareFromFolderWithFile() { $node1 = $this->userFolder->get($this->filename); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -610,7 +610,7 @@ class ApiTest extends TestCase { * share a folder, than reshare a file within the shared folder and check if we construct the correct path * @medium */ - function testGetShareFromFolderReshares() { + public function testGetShareFromFolderReshares() { $node1 = $this->userFolder->get($this->folder); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -670,7 +670,7 @@ class ApiTest extends TestCase { * reshare a sub folder and check if we get the correct path * @medium */ - function testGetShareFromSubFolderReShares() { + public function testGetShareFromSubFolderReShares() { $node1 = $this->userFolder->get($this->folder . $this->subfolder); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -712,7 +712,7 @@ class ApiTest extends TestCase { * test re-re-share of folder if the path gets constructed correctly * @medium */ - function XtestGetShareFromFolderReReShares() { + public function XtestGetShareFromFolderReReShares() { $node1 = $this->userFolder->get($this->folder . $this->subfolder); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -789,7 +789,7 @@ class ApiTest extends TestCase { * test multiple shared folder if the path gets constructed correctly * @medium */ - function testGetShareMultipleSharedFolder() { + public function testGetShareMultipleSharedFolder() { $this->setUp(); $node1 = $this->userFolder->get($this->folder . $this->subfolder); $share1 = $this->shareManager->newShare(); @@ -854,7 +854,7 @@ class ApiTest extends TestCase { * test re-re-share of folder if the path gets constructed correctly * @medium */ - function testGetShareFromFileReReShares() { + public function testGetShareFromFileReReShares() { $node1 = $this->userFolder->get($this->folder . $this->subfolder); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -909,7 +909,7 @@ class ApiTest extends TestCase { /** * @medium */ - function testGetShareFromUnknownId() { + public function testGetShareFromUnknownId() { $ocs = $this->createOCS(self::TEST_FILES_SHARING_API_USER3); try { $ocs->getShare(0); @@ -925,7 +925,7 @@ class ApiTest extends TestCase { * @depends testCreateShareUserFile * @depends testCreateShareLink */ - function testUpdateShare() { + public function testUpdateShare() { $password = md5(time()); $node1 = $this->userFolder->get($this->filename); @@ -976,7 +976,7 @@ class ApiTest extends TestCase { /** * @medium */ - function testUpdateShareUpload() { + public function testUpdateShareUpload() { $node1 = $this->userFolder->get($this->folder); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -1006,7 +1006,7 @@ class ApiTest extends TestCase { /** * @medium */ - function testUpdateShareExpireDate() { + public function testUpdateShareExpireDate() { $node1 = $this->userFolder->get($this->folder); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -1078,7 +1078,7 @@ class ApiTest extends TestCase { * @medium * @depends testCreateShareUserFile */ - function testDeleteShare() { + public function testDeleteShare() { $node1 = $this->userFolder->get($this->filename); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) @@ -1110,7 +1110,7 @@ class ApiTest extends TestCase { /** * test unshare of a reshared file */ - function testDeleteReshare() { + public function testDeleteReshare() { $node1 = $this->userFolder->get($this->folder); $share1 = $this->shareManager->newShare(); $share1->setNode($node1) diff --git a/apps/files_sharing/tests/CacheTest.php b/apps/files_sharing/tests/CacheTest.php index 355a1a8bb1b..09fc9f6f5a7 100644 --- a/apps/files_sharing/tests/CacheTest.php +++ b/apps/files_sharing/tests/CacheTest.php @@ -147,7 +147,7 @@ class CacheTest extends TestCase { parent::tearDown(); } - function searchDataProvider() { + public function searchDataProvider() { return [ ['%another%', [ @@ -211,7 +211,7 @@ class CacheTest extends TestCase { * we cannot use a dataProvider because that would cause the stray hook detection to remove the hooks * that were added in setUpBeforeClass. */ - function testSearch() { + public function testSearch() { foreach ($this->searchDataProvider() as $data) { list($pattern, $expectedFiles) = $data; @@ -223,7 +223,7 @@ class CacheTest extends TestCase { /** * Test searching by mime type */ - function testSearchByMime() { + public function testSearchByMime() { $results = $this->sharedStorage->getCache()->searchByMime('text'); $check = [ [ @@ -242,7 +242,7 @@ class CacheTest extends TestCase { $this->verifyFiles($check, $results); } - function testGetFolderContentsInRoot() { + public function testGetFolderContentsInRoot() { $results = $this->user2View->getDirectoryContent('/'); // we should get the shared items "shareddir" and "shared single file.txt" @@ -274,7 +274,7 @@ class CacheTest extends TestCase { ); } - function testGetFolderContentsInSubdir() { + public function testGetFolderContentsInSubdir() { $results = $this->user2View->getDirectoryContent('/shareddir'); $this->verifyFiles( @@ -305,7 +305,7 @@ class CacheTest extends TestCase { ); } - function testGetFolderContentsWhenSubSubdirShared() { + public function testGetFolderContentsWhenSubSubdirShared() { self::loginHelper(self::TEST_FILES_SHARING_API_USER1); $rootFolder = \OC::$server->getUserFolder(self::TEST_FILES_SHARING_API_USER1); diff --git a/apps/files_sharing/tests/ExternalStorageTest.php b/apps/files_sharing/tests/ExternalStorageTest.php index fa8df930a4e..b8c1db6c9da 100644 --- a/apps/files_sharing/tests/ExternalStorageTest.php +++ b/apps/files_sharing/tests/ExternalStorageTest.php @@ -39,7 +39,7 @@ use OCP\Http\Client\IResponse; * @group DB */ class ExternalStorageTest extends \Test\TestCase { - function optionsProvider() { + public function optionsProvider() { return [ [ 'http://remoteserver:8080/owncloud', diff --git a/apps/files_sharing/tests/PermissionsTest.php b/apps/files_sharing/tests/PermissionsTest.php index edbaf2f555a..4d21b3e0eb7 100644 --- a/apps/files_sharing/tests/PermissionsTest.php +++ b/apps/files_sharing/tests/PermissionsTest.php @@ -137,7 +137,7 @@ class PermissionsTest extends TestCase { /** * Test that the permissions of shared directory are returned correctly */ - function testGetPermissions() { + public function testGetPermissions() { $sharedDirPerms = $this->sharedStorage->getPermissions(''); $this->assertEquals(31, $sharedDirPerms); $sharedDirPerms = $this->sharedStorage->getPermissions('textfile.txt'); @@ -151,7 +151,7 @@ class PermissionsTest extends TestCase { /** * Test that the permissions of shared directory are returned correctly */ - function testGetDirectoryPermissions() { + public function testGetDirectoryPermissions() { $contents = $this->secondView->getDirectoryContent('files/shareddir'); $this->assertEquals('subdir', $contents[0]['name']); $this->assertEquals(31, $contents[0]['permissions']); diff --git a/apps/files_sharing/tests/WatcherTest.php b/apps/files_sharing/tests/WatcherTest.php index e483b2e1d92..e105bf16161 100644 --- a/apps/files_sharing/tests/WatcherTest.php +++ b/apps/files_sharing/tests/WatcherTest.php @@ -111,7 +111,7 @@ class WatcherTest extends TestCase { * Tests that writing a file using the shared storage will propagate the file * size to the owner's parent folders. */ - function testFolderSizePropagationToOwnerStorage() { + public function testFolderSizePropagationToOwnerStorage() { $initialSizes = self::getOwnerDirSizes('files/container/shareddir'); $textData = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; @@ -141,7 +141,7 @@ class WatcherTest extends TestCase { * Tests that writing a file using the shared storage will propagate the file * size to the owner's parent folders. */ - function testSubFolderSizePropagationToOwnerStorage() { + public function testSubFolderSizePropagationToOwnerStorage() { $initialSizes = self::getOwnerDirSizes('files/container/shareddir/subdir'); $textData = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; @@ -173,7 +173,7 @@ class WatcherTest extends TestCase { * where the key is the path and the value is the size. * @param string $path */ - function getOwnerDirSizes($path) { + public function getOwnerDirSizes($path) { $result = []; while ($path != '' && $path != '' && $path != '.') { |