From 5001036fd49cecdf1dcda1b4aed0be1b24d18c24 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 17 May 2016 10:31:50 +0200 Subject: [PATCH 1/4] Move classes from outside lib/ to PSR-4 --- apps/files_sharing/appinfo/app.php | 4 +--- apps/files_sharing/appinfo/info.xml | 2 ++ apps/files_sharing/appinfo/routes.php | 3 +-- .../{api/ocssharewrapper.php => lib/API/OCSShareWrapper.php} | 0 apps/files_sharing/{api/remote.php => lib/API/Remote.php} | 0 .../{api/share20ocs.php => lib/API/Share20OCS.php} | 0 apps/files_sharing/{api/sharees.php => lib/API/Sharees.php} | 0 .../{appinfo/application.php => lib/AppInfo/Application.php} | 0 apps/files_sharing/tests/testcase.php | 2 +- 9 files changed, 5 insertions(+), 6 deletions(-) rename apps/files_sharing/{api/ocssharewrapper.php => lib/API/OCSShareWrapper.php} (100%) rename apps/files_sharing/{api/remote.php => lib/API/Remote.php} (100%) rename apps/files_sharing/{api/share20ocs.php => lib/API/Share20OCS.php} (100%) rename apps/files_sharing/{api/sharees.php => lib/API/Sharees.php} (100%) rename apps/files_sharing/{appinfo/application.php => lib/AppInfo/Application.php} (100%) diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php index 32eee9b6c9..e96269d114 100644 --- a/apps/files_sharing/appinfo/app.php +++ b/apps/files_sharing/appinfo/app.php @@ -26,15 +26,13 @@ * */ -namespace OCA\Files_Sharing\Appinfo; - $l = \OC::$server->getL10N('files_sharing'); \OC::$CLASSPATH['OC_Share_Backend_File'] = 'files_sharing/lib/share/file.php'; \OC::$CLASSPATH['OC_Share_Backend_Folder'] = 'files_sharing/lib/share/folder.php'; \OC::$CLASSPATH['OC\Files\Storage\Shared'] = 'files_sharing/lib/sharedstorage.php'; -$application = new Application(); +$application = new \OCA\Files_Sharing\AppInfo\Application(); $application->registerMountProviders(); \OCA\Files_Sharing\Helper::registerHooks(); diff --git a/apps/files_sharing/appinfo/info.xml b/apps/files_sharing/appinfo/info.xml index 7e49e26727..f6e3053961 100644 --- a/apps/files_sharing/appinfo/info.xml +++ b/apps/files_sharing/appinfo/info.xml @@ -21,6 +21,8 @@ Turning the feature off removes shared files and folders on the server for all s public.php + Files_Sharing + OCA\Files_sharing\Lib\DeleteOrphanedSharesJob OCA\Files_sharing\ExpireSharesJob diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php index 80632f0fed..2e11e0e62b 100644 --- a/apps/files_sharing/appinfo/routes.php +++ b/apps/files_sharing/appinfo/routes.php @@ -24,11 +24,10 @@ * along with this program. If not, see * */ -namespace OCA\Files_Sharing\AppInfo; use OCP\API; -$application = new Application(); +$application = new \OCA\Files_Sharing\AppInfo\Application(); $application->registerRoutes($this, [ 'resources' => [ 'ExternalShares' => ['url' => '/api/externalShares'], diff --git a/apps/files_sharing/api/ocssharewrapper.php b/apps/files_sharing/lib/API/OCSShareWrapper.php similarity index 100% rename from apps/files_sharing/api/ocssharewrapper.php rename to apps/files_sharing/lib/API/OCSShareWrapper.php diff --git a/apps/files_sharing/api/remote.php b/apps/files_sharing/lib/API/Remote.php similarity index 100% rename from apps/files_sharing/api/remote.php rename to apps/files_sharing/lib/API/Remote.php diff --git a/apps/files_sharing/api/share20ocs.php b/apps/files_sharing/lib/API/Share20OCS.php similarity index 100% rename from apps/files_sharing/api/share20ocs.php rename to apps/files_sharing/lib/API/Share20OCS.php diff --git a/apps/files_sharing/api/sharees.php b/apps/files_sharing/lib/API/Sharees.php similarity index 100% rename from apps/files_sharing/api/sharees.php rename to apps/files_sharing/lib/API/Sharees.php diff --git a/apps/files_sharing/appinfo/application.php b/apps/files_sharing/lib/AppInfo/Application.php similarity index 100% rename from apps/files_sharing/appinfo/application.php rename to apps/files_sharing/lib/AppInfo/Application.php diff --git a/apps/files_sharing/tests/testcase.php b/apps/files_sharing/tests/testcase.php index b1d6facafd..9078a3d457 100644 --- a/apps/files_sharing/tests/testcase.php +++ b/apps/files_sharing/tests/testcase.php @@ -32,7 +32,7 @@ namespace OCA\Files_Sharing\Tests; use OC\Files\Filesystem; use OCA\Files\Share; -use OCA\Files_Sharing\Appinfo\Application; +use OCA\Files_Sharing\AppInfo\Application; /** * Class Test_Files_Sharing_Base From 3a716ae91c20f48737ad5f9192b20967252e74ec Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 17 May 2016 10:36:56 +0200 Subject: [PATCH 2/4] Move lib/ to PSR-4 --- apps/federatedfilesharing/lib/{notifier.php => Notifier.php} | 0 apps/files_sharing/lib/{activity.php => Activity.php} | 0 apps/files_sharing/lib/{cache.php => Cache.php} | 0 apps/files_sharing/lib/{capabilities.php => Capabilities.php} | 0 .../ExternalSharesController.php} | 0 .../sharecontroller.php => Controllers/ShareController.php} | 0 .../lib/{exceptions/brokenpath.php => Exceptions/BrokenPath.php} | 0 .../{exceptions/s2sexception.php => Exceptions/S2SException.php} | 0 .../lib/{expiresharesjob.php => ExpireSharesJob.php} | 0 apps/files_sharing/lib/{external/cache.php => External/Cache.php} | 0 .../lib/{external/manager.php => External/Manager.php} | 0 apps/files_sharing/lib/{external/mount.php => External/Mount.php} | 0 .../{external/mountprovider.php => External/MountProvider.php} | 0 .../lib/{external/scanner.php => External/Scanner.php} | 0 .../lib/{external/storage.php => External/Storage.php} | 0 apps/files_sharing/lib/{helper.php => Helper.php} | 0 apps/files_sharing/lib/{hooks.php => Hooks.php} | 0 apps/files_sharing/lib/{isharedstorage.php => ISharedStorage.php} | 0 apps/files_sharing/lib/{maintainer.php => Maintainer.php} | 0 .../SharingCheckMiddleware.php} | 0 apps/files_sharing/lib/{migration.php => Migration.php} | 0 apps/files_sharing/lib/{mountprovider.php => MountProvider.php} | 0 apps/files_sharing/lib/{scanner.php => Scanner.php} | 0 apps/files_sharing/lib/{sharedmount.php => SharedMount.php} | 0 .../lib/{sharedpropagator.php => SharedPropagator.php} | 0 apps/files_sharing/lib/{updater.php => Updater.php} | 0 26 files changed, 0 insertions(+), 0 deletions(-) rename apps/federatedfilesharing/lib/{notifier.php => Notifier.php} (100%) rename apps/files_sharing/lib/{activity.php => Activity.php} (100%) rename apps/files_sharing/lib/{cache.php => Cache.php} (100%) rename apps/files_sharing/lib/{capabilities.php => Capabilities.php} (100%) rename apps/files_sharing/lib/{controllers/externalsharescontroller.php => Controllers/ExternalSharesController.php} (100%) rename apps/files_sharing/lib/{controllers/sharecontroller.php => Controllers/ShareController.php} (100%) rename apps/files_sharing/lib/{exceptions/brokenpath.php => Exceptions/BrokenPath.php} (100%) rename apps/files_sharing/lib/{exceptions/s2sexception.php => Exceptions/S2SException.php} (100%) rename apps/files_sharing/lib/{expiresharesjob.php => ExpireSharesJob.php} (100%) rename apps/files_sharing/lib/{external/cache.php => External/Cache.php} (100%) rename apps/files_sharing/lib/{external/manager.php => External/Manager.php} (100%) rename apps/files_sharing/lib/{external/mount.php => External/Mount.php} (100%) rename apps/files_sharing/lib/{external/mountprovider.php => External/MountProvider.php} (100%) rename apps/files_sharing/lib/{external/scanner.php => External/Scanner.php} (100%) rename apps/files_sharing/lib/{external/storage.php => External/Storage.php} (100%) rename apps/files_sharing/lib/{helper.php => Helper.php} (100%) rename apps/files_sharing/lib/{hooks.php => Hooks.php} (100%) rename apps/files_sharing/lib/{isharedstorage.php => ISharedStorage.php} (100%) rename apps/files_sharing/lib/{maintainer.php => Maintainer.php} (100%) rename apps/files_sharing/lib/{middleware/sharingcheckmiddleware.php => Middleware/SharingCheckMiddleware.php} (100%) rename apps/files_sharing/lib/{migration.php => Migration.php} (100%) rename apps/files_sharing/lib/{mountprovider.php => MountProvider.php} (100%) rename apps/files_sharing/lib/{scanner.php => Scanner.php} (100%) rename apps/files_sharing/lib/{sharedmount.php => SharedMount.php} (100%) rename apps/files_sharing/lib/{sharedpropagator.php => SharedPropagator.php} (100%) rename apps/files_sharing/lib/{updater.php => Updater.php} (100%) diff --git a/apps/federatedfilesharing/lib/notifier.php b/apps/federatedfilesharing/lib/Notifier.php similarity index 100% rename from apps/federatedfilesharing/lib/notifier.php rename to apps/federatedfilesharing/lib/Notifier.php diff --git a/apps/files_sharing/lib/activity.php b/apps/files_sharing/lib/Activity.php similarity index 100% rename from apps/files_sharing/lib/activity.php rename to apps/files_sharing/lib/Activity.php diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/Cache.php similarity index 100% rename from apps/files_sharing/lib/cache.php rename to apps/files_sharing/lib/Cache.php diff --git a/apps/files_sharing/lib/capabilities.php b/apps/files_sharing/lib/Capabilities.php similarity index 100% rename from apps/files_sharing/lib/capabilities.php rename to apps/files_sharing/lib/Capabilities.php diff --git a/apps/files_sharing/lib/controllers/externalsharescontroller.php b/apps/files_sharing/lib/Controllers/ExternalSharesController.php similarity index 100% rename from apps/files_sharing/lib/controllers/externalsharescontroller.php rename to apps/files_sharing/lib/Controllers/ExternalSharesController.php diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/Controllers/ShareController.php similarity index 100% rename from apps/files_sharing/lib/controllers/sharecontroller.php rename to apps/files_sharing/lib/Controllers/ShareController.php diff --git a/apps/files_sharing/lib/exceptions/brokenpath.php b/apps/files_sharing/lib/Exceptions/BrokenPath.php similarity index 100% rename from apps/files_sharing/lib/exceptions/brokenpath.php rename to apps/files_sharing/lib/Exceptions/BrokenPath.php diff --git a/apps/files_sharing/lib/exceptions/s2sexception.php b/apps/files_sharing/lib/Exceptions/S2SException.php similarity index 100% rename from apps/files_sharing/lib/exceptions/s2sexception.php rename to apps/files_sharing/lib/Exceptions/S2SException.php diff --git a/apps/files_sharing/lib/expiresharesjob.php b/apps/files_sharing/lib/ExpireSharesJob.php similarity index 100% rename from apps/files_sharing/lib/expiresharesjob.php rename to apps/files_sharing/lib/ExpireSharesJob.php diff --git a/apps/files_sharing/lib/external/cache.php b/apps/files_sharing/lib/External/Cache.php similarity index 100% rename from apps/files_sharing/lib/external/cache.php rename to apps/files_sharing/lib/External/Cache.php diff --git a/apps/files_sharing/lib/external/manager.php b/apps/files_sharing/lib/External/Manager.php similarity index 100% rename from apps/files_sharing/lib/external/manager.php rename to apps/files_sharing/lib/External/Manager.php diff --git a/apps/files_sharing/lib/external/mount.php b/apps/files_sharing/lib/External/Mount.php similarity index 100% rename from apps/files_sharing/lib/external/mount.php rename to apps/files_sharing/lib/External/Mount.php diff --git a/apps/files_sharing/lib/external/mountprovider.php b/apps/files_sharing/lib/External/MountProvider.php similarity index 100% rename from apps/files_sharing/lib/external/mountprovider.php rename to apps/files_sharing/lib/External/MountProvider.php diff --git a/apps/files_sharing/lib/external/scanner.php b/apps/files_sharing/lib/External/Scanner.php similarity index 100% rename from apps/files_sharing/lib/external/scanner.php rename to apps/files_sharing/lib/External/Scanner.php diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/External/Storage.php similarity index 100% rename from apps/files_sharing/lib/external/storage.php rename to apps/files_sharing/lib/External/Storage.php diff --git a/apps/files_sharing/lib/helper.php b/apps/files_sharing/lib/Helper.php similarity index 100% rename from apps/files_sharing/lib/helper.php rename to apps/files_sharing/lib/Helper.php diff --git a/apps/files_sharing/lib/hooks.php b/apps/files_sharing/lib/Hooks.php similarity index 100% rename from apps/files_sharing/lib/hooks.php rename to apps/files_sharing/lib/Hooks.php diff --git a/apps/files_sharing/lib/isharedstorage.php b/apps/files_sharing/lib/ISharedStorage.php similarity index 100% rename from apps/files_sharing/lib/isharedstorage.php rename to apps/files_sharing/lib/ISharedStorage.php diff --git a/apps/files_sharing/lib/maintainer.php b/apps/files_sharing/lib/Maintainer.php similarity index 100% rename from apps/files_sharing/lib/maintainer.php rename to apps/files_sharing/lib/Maintainer.php diff --git a/apps/files_sharing/lib/middleware/sharingcheckmiddleware.php b/apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php similarity index 100% rename from apps/files_sharing/lib/middleware/sharingcheckmiddleware.php rename to apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php diff --git a/apps/files_sharing/lib/migration.php b/apps/files_sharing/lib/Migration.php similarity index 100% rename from apps/files_sharing/lib/migration.php rename to apps/files_sharing/lib/Migration.php diff --git a/apps/files_sharing/lib/mountprovider.php b/apps/files_sharing/lib/MountProvider.php similarity index 100% rename from apps/files_sharing/lib/mountprovider.php rename to apps/files_sharing/lib/MountProvider.php diff --git a/apps/files_sharing/lib/scanner.php b/apps/files_sharing/lib/Scanner.php similarity index 100% rename from apps/files_sharing/lib/scanner.php rename to apps/files_sharing/lib/Scanner.php diff --git a/apps/files_sharing/lib/sharedmount.php b/apps/files_sharing/lib/SharedMount.php similarity index 100% rename from apps/files_sharing/lib/sharedmount.php rename to apps/files_sharing/lib/SharedMount.php diff --git a/apps/files_sharing/lib/sharedpropagator.php b/apps/files_sharing/lib/SharedPropagator.php similarity index 100% rename from apps/files_sharing/lib/sharedpropagator.php rename to apps/files_sharing/lib/SharedPropagator.php diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/Updater.php similarity index 100% rename from apps/files_sharing/lib/updater.php rename to apps/files_sharing/lib/Updater.php From b72706b450dd483bc25b0fd95266a8ac6c635ae6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 17 May 2016 10:44:49 +0200 Subject: [PATCH 3/4] Move background job to PSR-4 --- apps/files_sharing/appinfo/info.xml | 4 ++-- ...eleteorphanedsharesjob.php => DeleteOrphanedSharesJob.php} | 2 +- lib/private/Repair/DropOldJobs.php | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) rename apps/files_sharing/lib/{deleteorphanedsharesjob.php => DeleteOrphanedSharesJob.php} (98%) diff --git a/apps/files_sharing/appinfo/info.xml b/apps/files_sharing/appinfo/info.xml index f6e3053961..c1f98aa94a 100644 --- a/apps/files_sharing/appinfo/info.xml +++ b/apps/files_sharing/appinfo/info.xml @@ -24,7 +24,7 @@ Turning the feature off removes shared files and folders on the server for all s Files_Sharing - OCA\Files_sharing\Lib\DeleteOrphanedSharesJob - OCA\Files_sharing\ExpireSharesJob + OCA\Files_Sharing\DeleteOrphanedSharesJob + OCA\Files_Sharing\ExpireSharesJob diff --git a/apps/files_sharing/lib/deleteorphanedsharesjob.php b/apps/files_sharing/lib/DeleteOrphanedSharesJob.php similarity index 98% rename from apps/files_sharing/lib/deleteorphanedsharesjob.php rename to apps/files_sharing/lib/DeleteOrphanedSharesJob.php index 72bf6b222e..2678d46661 100644 --- a/apps/files_sharing/lib/deleteorphanedsharesjob.php +++ b/apps/files_sharing/lib/DeleteOrphanedSharesJob.php @@ -20,7 +20,7 @@ * */ -namespace OCA\Files_sharing\Lib; +namespace OCA\Files_Sharing; use OC\BackgroundJob\TimedJob; diff --git a/lib/private/Repair/DropOldJobs.php b/lib/private/Repair/DropOldJobs.php index 489b89d086..c040aa0396 100644 --- a/lib/private/Repair/DropOldJobs.php +++ b/lib/private/Repair/DropOldJobs.php @@ -73,6 +73,8 @@ class DropOldJobs implements IRepairStep { ['class' => 'OC_Cache_FileGlobalGC', 'arguments' => null], ['class' => 'OC\Cache\FileGlobalGC', 'arguments' => null], ['class' => 'OCA\Files\BackgroundJob\DeleteOrphanedTagsJob', 'arguments' => null], + ['class' => 'OCA\Files_sharing\Lib\DeleteOrphanedSharesJob', 'arguments' => null], + ['class' => 'OCA\Files_sharing\ExpireSharesJob', 'arguments' => null], ]; } From 3f0b2d148d875a2a4961a5b27309d379b9de1329 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 17 May 2016 11:42:03 +0200 Subject: [PATCH 4/4] Move tests to PSR-4 --- .../Share20OCSTest.php} | 0 .../shareestest.php => API/ShareesTest.php} | 2 +- .../tests/{activity.php => ActivityTest.php} | 8 +-- .../tests/{api.php => ApiTest.php} | 63 +++++++++---------- .../tests/{backend.php => BackendTest.php} | 8 +-- .../tests/{cache.php => CacheTest.php} | 8 +-- ...{capabilities.php => CapabilitiesTest.php} | 4 +- .../ExternalShareControllerTest.php} | 4 +- .../ShareControllerTest.php} | 5 +- ...st.php => DeleteOrphanedSharesJobTest.php} | 6 +- ...n.php => EncryptedSizePropagationTest.php} | 4 +- ...ropagation.php => EtagPropagationTest.php} | 8 +-- ...resjobtest.php => ExpireSharesJobTest.php} | 0 .../cache.php => External/CacheTest.php} | 8 +-- .../ManagerTest.php} | 0 .../ScannerTest.php} | 0 ...nalstorage.php => ExternalStorageTest.php} | 4 +- ...ation.php => GroupEtagPropagationTest.php} | 6 +- .../tests/{helper.php => HelperTest.php} | 7 ++- .../tests/{locking.php => LockingTest.php} | 8 +-- .../SharingCheckMiddlewareTest.php} | 0 .../{migrationtest.php => MigrationTest.php} | 3 +- .../{permissions.php => PermissionsTest.php} | 8 ++- ...ontestcase.php => PropagationTestCase.php} | 2 +- .../tests/{share.php => ShareTest.php} | 12 ++-- .../{sharedmount.php => SharedMountTest.php} | 6 +- ...haredstorage.php => SharedStorageTest.php} | 6 +- ...ropagation.php => SizePropagationTest.php} | 8 +-- .../tests/{testcase.php => TestCase.php} | 3 +- ...rechildren.php => UnshareChildrenTest.php} | 10 ++- .../tests/{updater.php => UpdaterTest.php} | 5 +- .../tests/{watcher.php => WatcherTest.php} | 6 +- 32 files changed, 118 insertions(+), 104 deletions(-) rename apps/files_sharing/tests/{api/share20ocstest.php => API/Share20OCSTest.php} (100%) rename apps/files_sharing/tests/{api/shareestest.php => API/ShareesTest.php} (99%) rename apps/files_sharing/tests/{activity.php => ActivityTest.php} (93%) rename apps/files_sharing/tests/{api.php => ApiTest.php} (95%) rename apps/files_sharing/tests/{backend.php => BackendTest.php} (96%) rename apps/files_sharing/tests/{cache.php => CacheTest.php} (99%) rename apps/files_sharing/tests/{capabilities.php => CapabilitiesTest.php} (98%) rename apps/files_sharing/tests/{controller/externalsharecontroller.php => Controllers/ExternalShareControllerTest.php} (97%) rename apps/files_sharing/tests/{controller/sharecontroller.php => Controllers/ShareControllerTest.php} (99%) rename apps/files_sharing/tests/{deleteorphanedsharesjobtest.php => DeleteOrphanedSharesJobTest.php} (97%) rename apps/files_sharing/tests/{encryptedsizepropagation.php => EncryptedSizePropagationTest.php} (92%) rename apps/files_sharing/tests/{etagpropagation.php => EtagPropagationTest.php} (99%) rename apps/files_sharing/tests/{expiresharesjobtest.php => ExpireSharesJobTest.php} (100%) rename apps/files_sharing/tests/{external/cache.php => External/CacheTest.php} (94%) rename apps/files_sharing/tests/{external/managertest.php => External/ManagerTest.php} (100%) rename apps/files_sharing/tests/{external/scannertest.php => External/ScannerTest.php} (100%) rename apps/files_sharing/tests/{externalstorage.php => ExternalStorageTest.php} (96%) rename apps/files_sharing/tests/{groupetagpropagation.php => GroupEtagPropagationTest.php} (97%) rename apps/files_sharing/tests/{helper.php => HelperTest.php} (91%) rename apps/files_sharing/tests/{locking.php => LockingTest.php} (96%) rename apps/files_sharing/tests/{middleware/sharingcheckmiddleware.php => Middleware/SharingCheckMiddlewareTest.php} (100%) rename apps/files_sharing/tests/{migrationtest.php => MigrationTest.php} (99%) rename apps/files_sharing/tests/{permissions.php => PermissionsTest.php} (97%) rename apps/files_sharing/tests/{propagationtestcase.php => PropagationTestCase.php} (98%) rename apps/files_sharing/tests/{share.php => ShareTest.php} (95%) rename apps/files_sharing/tests/{sharedmount.php => SharedMountTest.php} (99%) rename apps/files_sharing/tests/{sharedstorage.php => SharedStorageTest.php} (99%) rename apps/files_sharing/tests/{sizepropagation.php => SizePropagationTest.php} (96%) rename apps/files_sharing/tests/{testcase.php => TestCase.php} (99%) rename apps/files_sharing/tests/{unsharechildren.php => UnshareChildrenTest.php} (95%) rename apps/files_sharing/tests/{updater.php => UpdaterTest.php} (98%) rename apps/files_sharing/tests/{watcher.php => WatcherTest.php} (98%) diff --git a/apps/files_sharing/tests/api/share20ocstest.php b/apps/files_sharing/tests/API/Share20OCSTest.php similarity index 100% rename from apps/files_sharing/tests/api/share20ocstest.php rename to apps/files_sharing/tests/API/Share20OCSTest.php diff --git a/apps/files_sharing/tests/api/shareestest.php b/apps/files_sharing/tests/API/ShareesTest.php similarity index 99% rename from apps/files_sharing/tests/api/shareestest.php rename to apps/files_sharing/tests/API/ShareesTest.php index cda41f5518..8a88e7126e 100644 --- a/apps/files_sharing/tests/api/shareestest.php +++ b/apps/files_sharing/tests/API/ShareesTest.php @@ -25,7 +25,7 @@ namespace OCA\Files_Sharing\Tests\API; use OCA\Files_Sharing\API\Sharees; -use OCA\Files_sharing\Tests\TestCase; +use OCA\Files_Sharing\Tests\TestCase; use OCP\AppFramework\Http; use OCP\Share; diff --git a/apps/files_sharing/tests/activity.php b/apps/files_sharing/tests/ActivityTest.php similarity index 93% rename from apps/files_sharing/tests/activity.php rename to apps/files_sharing/tests/ActivityTest.php index 40a1031f77..2894d485ac 100644 --- a/apps/files_sharing/tests/activity.php +++ b/apps/files_sharing/tests/ActivityTest.php @@ -22,16 +22,16 @@ * */ -namespace OCA\Files_sharing\Tests; +namespace OCA\Files_Sharing\Tests; /** - * Class Activity + * Class ActivityTest * * @group DB * - * @package OCA\Files_sharing\Tests + * @package OCA\Files_Sharing\Tests */ -class Activity extends \OCA\Files_Sharing\Tests\TestCase { +class ActivityTest extends TestCase { /** * @var \OCA\Files_Sharing\Activity diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/ApiTest.php similarity index 95% rename from apps/files_sharing/tests/api.php rename to apps/files_sharing/tests/ApiTest.php index 3ded1bfc5d..3a2d42a646 100644 --- a/apps/files_sharing/tests/api.php +++ b/apps/files_sharing/tests/ApiTest.php @@ -26,15 +26,14 @@ * */ -use OCA\Files\Share; -use OCA\Files_sharing\Tests\TestCase; +namespace OCA\Files_Sharing\Tests; /** - * Class Test_Files_Sharing_Api + * Class ApiTest * * @group DB */ -class Test_Files_Sharing_Api extends TestCase { +class ApiTest extends TestCase { const TEST_FOLDER_NAME = '/folder_share_api_test'; @@ -125,7 +124,7 @@ class Test_Files_Sharing_Api extends TestCase { function testCreateShareUserFile() { // simulate a post request $data['path'] = $this->filename; - $data['shareWith'] = \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2; + $data['shareWith'] = self::TEST_FILES_SHARING_API_USER2; $data['shareType'] = \OCP\Share::SHARE_TYPE_USER; $request = $this->createRequest($data); @@ -148,7 +147,7 @@ class Test_Files_Sharing_Api extends TestCase { function testCreateShareUserFolder() { // simulate a post request $data['path'] = $this->folder; - $data['shareWith'] = \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2; + $data['shareWith'] = self::TEST_FILES_SHARING_API_USER2; $data['shareType'] = \OCP\Share::SHARE_TYPE_USER; $request = $this->createRequest($data); @@ -172,7 +171,7 @@ class Test_Files_Sharing_Api extends TestCase { function testCreateShareGroupFile() { // simulate a post request $data['path'] = $this->filename; - $data['shareWith'] = \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_GROUP1; + $data['shareWith'] = self::TEST_FILES_SHARING_API_GROUP1; $data['shareType'] = \OCP\Share::SHARE_TYPE_GROUP; $request = $this->createRequest($data); @@ -195,7 +194,7 @@ class Test_Files_Sharing_Api extends TestCase { function testCreateShareGroupFolder() { // simulate a post request $data['path'] = $this->folder; - $data['shareWith'] = \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_GROUP1; + $data['shareWith'] = self::TEST_FILES_SHARING_API_GROUP1; $data['shareType'] = \OCP\Share::SHARE_TYPE_GROUP; $request = $this->createRequest($data); @@ -347,7 +346,7 @@ class Test_Files_Sharing_Api extends TestCase { // to no \OC::$server->getAppConfig()->setValue('core', 'shareapi_exclude_groups', 'no'); $post['path'] = $this->filename; - $post['shareWith'] = \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2; + $post['shareWith'] = self::TEST_FILES_SHARING_API_USER2; $post['shareType'] = \OCP\Share::SHARE_TYPE_USER; $request = $this->createRequest($post); @@ -370,7 +369,7 @@ class Test_Files_Sharing_Api extends TestCase { $post = []; $post['path'] = $this->filename; - $post['shareWith'] = \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2; + $post['shareWith'] = self::TEST_FILES_SHARING_API_USER2; $post['shareType'] = \OCP\Share::SHARE_TYPE_USER; $request = $this->createRequest($post); @@ -392,7 +391,7 @@ class Test_Files_Sharing_Api extends TestCase { $post = []; $post['path'] = $this->filename; - $post['shareWith'] = \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2; + $post['shareWith'] = self::TEST_FILES_SHARING_API_USER2; $post['shareType'] = \OCP\Share::SHARE_TYPE_USER; $request = $this->createRequest($post); @@ -1194,7 +1193,7 @@ class Test_Files_Sharing_Api extends TestCase { */ public function testShareFolderWithAMountPoint() { // user 1 shares a folder with user2 - \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1); + self::loginHelper(self::TEST_FILES_SHARING_API_USER1); $fileInfo = $this->view->getFileInfo($this->folder); @@ -1207,9 +1206,9 @@ class Test_Files_Sharing_Api extends TestCase { ); // user2 shares a file from the folder as link - \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2); + self::loginHelper(self::TEST_FILES_SHARING_API_USER2); - $view = new \OC\Files\View('/' . \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2 . '/files'); + $view = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER2 . '/files'); $view->mkdir("localDir"); // move mount point to the folder "localDir" @@ -1242,7 +1241,7 @@ class Test_Files_Sharing_Api extends TestCase { $this->assertTrue($result !== false); $view->unlink('localDir'); - \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1); + self::loginHelper(self::TEST_FILES_SHARING_API_USER1); $this->shareManager->deleteShare($share); } @@ -1251,8 +1250,8 @@ class Test_Files_Sharing_Api extends TestCase { * Post init mount points hook for mounting simulated ext storage */ public static function initTestMountPointsHook($data) { - if ($data['user'] === \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1) { - \OC\Files\Filesystem::mount(self::$tempStorage, array(), '/' . \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1 . '/files' . self::TEST_FOLDER_NAME); + if ($data['user'] === self::TEST_FILES_SHARING_API_USER1) { + \OC\Files\Filesystem::mount(self::$tempStorage, array(), '/' . self::TEST_FILES_SHARING_API_USER1 . '/files' . self::TEST_FOLDER_NAME); } } @@ -1267,10 +1266,10 @@ class Test_Files_Sharing_Api extends TestCase { // needed because the sharing code sometimes switches the user internally and mounts the user's // storages. In our case the temp storage isn't mounted automatically, so doing it in the post hook // (similar to how ext storage works) - OCP\Util::connectHook('OC_Filesystem', 'post_initMountPoints', '\Test_Files_Sharing_Api', 'initTestMountPointsHook'); + \OCP\Util::connectHook('OC_Filesystem', 'post_initMountPoints', '\OCA\Files_Sharing\Tests\ApiTest', 'initTestMountPointsHook'); // logging in will auto-mount the temp storage for user1 as well - \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1); + self::loginHelper(self::TEST_FILES_SHARING_API_USER1); $fileInfo = $this->view->getFileInfo($this->folder); @@ -1284,44 +1283,44 @@ class Test_Files_Sharing_Api extends TestCase { ); // user2: check that mount point name appears correctly - \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2); + self::loginHelper(self::TEST_FILES_SHARING_API_USER2); - $view = new \OC\Files\View('/' . \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2 . '/files'); + $view = new \OC\Files\View('/' . self::TEST_FILES_SHARING_API_USER2 . '/files'); $this->assertTrue($view->file_exists($this->folder)); $this->assertTrue($view->file_exists($this->folder . '/test.txt')); - \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1); + self::loginHelper(self::TEST_FILES_SHARING_API_USER1); $this->shareManager->deleteShare($share); - \OC_Hook::clear('OC_Filesystem', 'post_initMountPoints', '\Test_Files_Sharing_Api', 'initTestMountPointsHook'); + \OC_Hook::clear('OC_Filesystem', 'post_initMountPoints', '\OCA\Files_Sharing\Tests\ApiTest', 'initTestMountPointsHook'); } /** * @expectedException \Exception */ public function testShareNonExisting() { - \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1); + self::loginHelper(self::TEST_FILES_SHARING_API_USER1); $id = PHP_INT_MAX - 1; - \OCP\Share::shareItem('file', $id, \OCP\Share::SHARE_TYPE_LINK, \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31); + \OCP\Share::shareItem('file', $id, \OCP\Share::SHARE_TYPE_LINK, self::TEST_FILES_SHARING_API_USER2, 31); } /** * @expectedException \Exception */ public function testShareNotOwner() { - \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2); + self::loginHelper(self::TEST_FILES_SHARING_API_USER2); \OC\Files\Filesystem::file_put_contents('foo.txt', 'bar'); $info = \OC\Files\Filesystem::getFileInfo('foo.txt'); - \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1); + self::loginHelper(self::TEST_FILES_SHARING_API_USER1); - \OCP\Share::shareItem('file', $info->getId(), \OCP\Share::SHARE_TYPE_LINK, \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31); + \OCP\Share::shareItem('file', $info->getId(), \OCP\Share::SHARE_TYPE_LINK, self::TEST_FILES_SHARING_API_USER2, 31); } public function testDefaultExpireDate() { - \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1); + self::loginHelper(self::TEST_FILES_SHARING_API_USER1); // TODO drop this once all code paths use the DI version - otherwise // the cache inside this config object is out of date because @@ -1346,13 +1345,13 @@ class Test_Files_Sharing_Api extends TestCase { $shareCreated = $now - 3 * 24 * 60 * 60; $expireDate = date($dateFormat, $now + 2 * 24 * 60 * 60); - $info = OC\Files\Filesystem::getFileInfo($this->filename); + $info = \OC\Files\Filesystem::getFileInfo($this->filename); $this->assertTrue($info instanceof \OC\Files\FileInfo); $result = \OCP\Share::shareItem('file', $info->getId(), \OCP\Share::SHARE_TYPE_LINK, null, \OCP\Constants::PERMISSION_READ); $this->assertTrue(is_string($result)); - $result = \OCP\Share::shareItem('file', $info->getId(), \OCP\Share::SHARE_TYPE_USER, \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31); + $result = \OCP\Share::shareItem('file', $info->getId(), \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2, 31); $this->assertTrue($result); $result = \OCP\Share::setExpirationDate('file', $info->getId() , $expireDate, $now); @@ -1376,7 +1375,7 @@ class Test_Files_Sharing_Api extends TestCase { $this->assertSame(\OCP\Share::SHARE_TYPE_USER, $share['share_type']); //cleanup - $result = \OCP\Share::unshare('file', $info->getId(), \OCP\Share::SHARE_TYPE_USER, \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2); + $result = \OCP\Share::unshare('file', $info->getId(), \OCP\Share::SHARE_TYPE_USER, self::TEST_FILES_SHARING_API_USER2); $this->assertTrue($result); $config->setAppValue('core', 'shareapi_default_expire_date', 'no'); $config->setAppValue('core', 'shareapi_enforce_expire_date', 'no'); diff --git a/apps/files_sharing/tests/backend.php b/apps/files_sharing/tests/BackendTest.php similarity index 96% rename from apps/files_sharing/tests/backend.php rename to apps/files_sharing/tests/BackendTest.php index e5e6ceb631..81037115f7 100644 --- a/apps/files_sharing/tests/backend.php +++ b/apps/files_sharing/tests/BackendTest.php @@ -23,15 +23,15 @@ * */ -use OCA\Files\Share; -use OCA\Files_sharing\Tests\TestCase; +namespace OCA\Files_Sharing\Tests; + /** - * Class Test_Files_Sharing + * Class BackendTest * * @group DB */ -class Test_Files_Sharing_Backend extends TestCase { +class BackendTest extends TestCase { const TEST_FOLDER_NAME = '/folder_share_api_test'; diff --git a/apps/files_sharing/tests/cache.php b/apps/files_sharing/tests/CacheTest.php similarity index 99% rename from apps/files_sharing/tests/cache.php rename to apps/files_sharing/tests/CacheTest.php index dd727c1c6f..f34301c961 100644 --- a/apps/files_sharing/tests/cache.php +++ b/apps/files_sharing/tests/CacheTest.php @@ -24,18 +24,18 @@ * along with this program. If not, see * */ -use OCA\Files_sharing\Tests\TestCase; +namespace OCA\Files_Sharing\Tests; /** - * Class Test_Files_Sharing_Cache + * Class CacheTest * * @group DB */ -class Test_Files_Sharing_Cache extends TestCase { +class CacheTest extends TestCase { /** - * @var OC\Files\View + * @var \OC\Files\View */ public $user2View; diff --git a/apps/files_sharing/tests/capabilities.php b/apps/files_sharing/tests/CapabilitiesTest.php similarity index 98% rename from apps/files_sharing/tests/capabilities.php rename to apps/files_sharing/tests/CapabilitiesTest.php index 0e17811be0..08797b2681 100644 --- a/apps/files_sharing/tests/capabilities.php +++ b/apps/files_sharing/tests/CapabilitiesTest.php @@ -26,11 +26,11 @@ use OCA\Files_Sharing\Capabilities; use OCA\Files_Sharing\Tests\TestCase; /** - * Class FilesSharingCapabilitiesTest + * Class CapabilitiesTest * * @group DB */ -class FilesSharingCapabilitiesTest extends \Test\TestCase { +class CapabilitiesTest extends \Test\TestCase { /** * Test for the general part in each return statement and assert. diff --git a/apps/files_sharing/tests/controller/externalsharecontroller.php b/apps/files_sharing/tests/Controllers/ExternalShareControllerTest.php similarity index 97% rename from apps/files_sharing/tests/controller/externalsharecontroller.php rename to apps/files_sharing/tests/Controllers/ExternalShareControllerTest.php index bd20bffb36..add6d2f08a 100644 --- a/apps/files_sharing/tests/controller/externalsharecontroller.php +++ b/apps/files_sharing/tests/Controllers/ExternalShareControllerTest.php @@ -20,8 +20,9 @@ * */ -namespace OCA\Files_Sharing\Controllers; +namespace OCA\Files_Sharing\Tests\Controllers; +use OCA\Files_Sharing\Controllers\ExternalSharesController; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\JSONResponse; use OCP\Http\Client\IClientService; @@ -41,6 +42,7 @@ class ExternalShareControllerTest extends \Test\TestCase { private $clientService; public function setUp() { + parent::setUp(); $this->request = $this->getMockBuilder('\\OCP\\IRequest') ->disableOriginalConstructor()->getMock(); $this->externalManager = $this->getMockBuilder('\\OCA\\Files_Sharing\\External\\Manager') diff --git a/apps/files_sharing/tests/controller/sharecontroller.php b/apps/files_sharing/tests/Controllers/ShareControllerTest.php similarity index 99% rename from apps/files_sharing/tests/controller/sharecontroller.php rename to apps/files_sharing/tests/Controllers/ShareControllerTest.php index f38ae10ca1..74e19aa29b 100644 --- a/apps/files_sharing/tests/controller/sharecontroller.php +++ b/apps/files_sharing/tests/Controllers/ShareControllerTest.php @@ -26,10 +26,11 @@ * */ -namespace OCA\Files_Sharing\Controllers; +namespace OCA\Files_Sharing\Tests\Controllers; use OC\Files\Filesystem; use OCA\FederatedFileSharing\FederatedShareProvider; +use OCA\Files_Sharing\Controllers\ShareController; use OCP\Share\Exceptions\ShareNotFound; use OCP\AppFramework\Http\NotFoundResponse; use OCP\AppFramework\Http\RedirectResponse; @@ -71,6 +72,7 @@ class ShareControllerTest extends \Test\TestCase { private $federatedShareProvider; protected function setUp() { + parent::setUp(); $this->appName = 'files_sharing'; $this->shareManager = $this->getMockBuilder('\OC\Share20\Manager')->disableOriginalConstructor()->getMock(); @@ -126,6 +128,7 @@ class ShareControllerTest extends \Test\TestCase { // Set old user \OC_User::setUserId($this->oldUser); \OC_Util::setupFS($this->oldUser); + parent::tearDown(); } public function testShowAuthenticateNotAuthenticated() { diff --git a/apps/files_sharing/tests/deleteorphanedsharesjobtest.php b/apps/files_sharing/tests/DeleteOrphanedSharesJobTest.php similarity index 97% rename from apps/files_sharing/tests/deleteorphanedsharesjobtest.php rename to apps/files_sharing/tests/DeleteOrphanedSharesJobTest.php index c9aea60d25..69d9ab228f 100644 --- a/apps/files_sharing/tests/deleteorphanedsharesjobtest.php +++ b/apps/files_sharing/tests/DeleteOrphanedSharesJobTest.php @@ -20,16 +20,16 @@ * */ -namespace Test\BackgroundJob; +namespace OCA\Files_Sharing\Tests; -use OCA\Files_sharing\Lib\DeleteOrphanedSharesJob; +use OCA\Files_Sharing\DeleteOrphanedSharesJob; /** * Class DeleteOrphanedSharesJobTest * * @group DB * - * @package Test\BackgroundJob + * @package OCA\Files_Sharing\Tests */ class DeleteOrphanedSharesJobTest extends \Test\TestCase { diff --git a/apps/files_sharing/tests/encryptedsizepropagation.php b/apps/files_sharing/tests/EncryptedSizePropagationTest.php similarity index 92% rename from apps/files_sharing/tests/encryptedsizepropagation.php rename to apps/files_sharing/tests/EncryptedSizePropagationTest.php index e341606abe..0abd9c39c9 100644 --- a/apps/files_sharing/tests/encryptedsizepropagation.php +++ b/apps/files_sharing/tests/EncryptedSizePropagationTest.php @@ -19,7 +19,7 @@ * */ -namespace OCA\Files_sharing\Tests; +namespace OCA\Files_Sharing\Tests; use OC\Files\View; use Test\Traits\EncryptionTrait; @@ -27,7 +27,7 @@ use Test\Traits\EncryptionTrait; /** * @group DB */ -class EncryptedSizePropagation extends SizePropagation { +class EncryptedSizePropagationTest extends SizePropagationTest { use EncryptionTrait; protected function setupUser($name, $password = '') { diff --git a/apps/files_sharing/tests/etagpropagation.php b/apps/files_sharing/tests/EtagPropagationTest.php similarity index 99% rename from apps/files_sharing/tests/etagpropagation.php rename to apps/files_sharing/tests/EtagPropagationTest.php index e7d5bb4625..bf53beccab 100644 --- a/apps/files_sharing/tests/etagpropagation.php +++ b/apps/files_sharing/tests/EtagPropagationTest.php @@ -23,19 +23,19 @@ * */ -namespace OCA\Files_sharing\Tests; +namespace OCA\Files_Sharing\Tests; use OC\Files\Filesystem; use OC\Files\View; /** - * Class EtagPropagation + * Class EtagPropagationTest * * @group DB * - * @package OCA\Files_sharing\Tests + * @package OCA\Files_Sharing\Tests */ -class EtagPropagation extends PropagationTestCase { +class EtagPropagationTest extends PropagationTestCase { /** * "user1" is the admin who shares a folder "sub1/sub2/folder" with "user2" and "user3" diff --git a/apps/files_sharing/tests/expiresharesjobtest.php b/apps/files_sharing/tests/ExpireSharesJobTest.php similarity index 100% rename from apps/files_sharing/tests/expiresharesjobtest.php rename to apps/files_sharing/tests/ExpireSharesJobTest.php diff --git a/apps/files_sharing/tests/external/cache.php b/apps/files_sharing/tests/External/CacheTest.php similarity index 94% rename from apps/files_sharing/tests/external/cache.php rename to apps/files_sharing/tests/External/CacheTest.php index 4ae1bc563d..6f207e1e4a 100644 --- a/apps/files_sharing/tests/external/cache.php +++ b/apps/files_sharing/tests/External/CacheTest.php @@ -20,18 +20,18 @@ * along with this program. If not, see * */ -namespace OCA\Files_sharing\Tests\External; +namespace OCA\Files_Sharing\Tests\External; -use OCA\Files_sharing\Tests\TestCase; +use OCA\Files_Sharing\Tests\TestCase; /** * Class Cache * * @group DB * - * @package OCA\Files_sharing\Tests\External + * @package OCA\Files_Sharing\Tests\External */ -class Cache extends TestCase { +class CacheTest extends TestCase { /** * @var \OC\Files\Storage\Storage diff --git a/apps/files_sharing/tests/external/managertest.php b/apps/files_sharing/tests/External/ManagerTest.php similarity index 100% rename from apps/files_sharing/tests/external/managertest.php rename to apps/files_sharing/tests/External/ManagerTest.php diff --git a/apps/files_sharing/tests/external/scannertest.php b/apps/files_sharing/tests/External/ScannerTest.php similarity index 100% rename from apps/files_sharing/tests/external/scannertest.php rename to apps/files_sharing/tests/External/ScannerTest.php diff --git a/apps/files_sharing/tests/externalstorage.php b/apps/files_sharing/tests/ExternalStorageTest.php similarity index 96% rename from apps/files_sharing/tests/externalstorage.php rename to apps/files_sharing/tests/ExternalStorageTest.php index 54cd7d1645..c5ff4ad023 100644 --- a/apps/files_sharing/tests/externalstorage.php +++ b/apps/files_sharing/tests/ExternalStorageTest.php @@ -23,12 +23,14 @@ * */ +namespace OCA\Files_Sharing\Tests; + /** * Tests for the external Storage class for remote shares. * * @group DB */ -class Test_Files_Sharing_External_Storage extends \Test\TestCase { +class ExternalStorageTest extends \Test\TestCase { function optionsProvider() { return array( diff --git a/apps/files_sharing/tests/groupetagpropagation.php b/apps/files_sharing/tests/GroupEtagPropagationTest.php similarity index 97% rename from apps/files_sharing/tests/groupetagpropagation.php rename to apps/files_sharing/tests/GroupEtagPropagationTest.php index aaa8113527..c78be79eaa 100644 --- a/apps/files_sharing/tests/groupetagpropagation.php +++ b/apps/files_sharing/tests/GroupEtagPropagationTest.php @@ -19,7 +19,7 @@ * */ -namespace OCA\Files_sharing\Tests; +namespace OCA\Files_Sharing\Tests; use OC\Files\Filesystem; use OC\Files\View; @@ -27,9 +27,9 @@ use OC\Files\View; /** * @group DB * - * @package OCA\Files_sharing\Tests + * @package OCA\Files_Sharing\Tests */ -class GroupEtagPropagation extends PropagationTestCase { +class GroupEtagPropagationTest extends PropagationTestCase { /** * "user1" creates /test, /test/sub and shares with group1 * "user2" (in group1) reshares /test with group2 and reshared /test/sub with group3 diff --git a/apps/files_sharing/tests/helper.php b/apps/files_sharing/tests/HelperTest.php similarity index 91% rename from apps/files_sharing/tests/helper.php rename to apps/files_sharing/tests/HelperTest.php index 07f07f911c..6382a8e18a 100644 --- a/apps/files_sharing/tests/helper.php +++ b/apps/files_sharing/tests/HelperTest.php @@ -20,14 +20,15 @@ * along with this program. If not, see * */ -use OCA\Files_sharing\Tests\TestCase; + +namespace OCA\Files_Sharing\Tests; /** - * Class Test_Files_Sharing_Helper + * Class HelperTest * * @group DB */ -class Test_Files_Sharing_Helper extends TestCase { +class HelperTest extends TestCase { /** * test set and get share folder diff --git a/apps/files_sharing/tests/locking.php b/apps/files_sharing/tests/LockingTest.php similarity index 96% rename from apps/files_sharing/tests/locking.php rename to apps/files_sharing/tests/LockingTest.php index 932afe006f..be6fa04437 100644 --- a/apps/files_sharing/tests/locking.php +++ b/apps/files_sharing/tests/LockingTest.php @@ -21,20 +21,20 @@ * */ -namespace OCA\Files_sharing\Tests; +namespace OCA\Files_Sharing\Tests; use OC\Files\Filesystem; use OC\Files\View; use OCP\Lock\ILockingProvider; /** - * Class Locking + * Class LockingTest * * @group DB * - * @package OCA\Files_sharing\Tests + * @package OCA\Files_Sharing\Tests */ -class Locking extends TestCase { +class LockingTest extends TestCase { /** * @var \Test\Util\User\Dummy */ diff --git a/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php b/apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php similarity index 100% rename from apps/files_sharing/tests/middleware/sharingcheckmiddleware.php rename to apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php diff --git a/apps/files_sharing/tests/migrationtest.php b/apps/files_sharing/tests/MigrationTest.php similarity index 99% rename from apps/files_sharing/tests/migrationtest.php rename to apps/files_sharing/tests/MigrationTest.php index 82e6f47add..4b44d7a367 100644 --- a/apps/files_sharing/tests/migrationtest.php +++ b/apps/files_sharing/tests/MigrationTest.php @@ -22,8 +22,9 @@ * */ +namespace OCA\Files_Sharing\Tests; + -use OCA\Files_Sharing\Tests\TestCase; use OCA\Files_Sharing\Migration; /** diff --git a/apps/files_sharing/tests/permissions.php b/apps/files_sharing/tests/PermissionsTest.php similarity index 97% rename from apps/files_sharing/tests/permissions.php rename to apps/files_sharing/tests/PermissionsTest.php index c1568ceab0..f22003c468 100644 --- a/apps/files_sharing/tests/permissions.php +++ b/apps/files_sharing/tests/PermissionsTest.php @@ -22,16 +22,20 @@ * along with this program. If not, see * */ + + +namespace OCA\Files_Sharing\Tests; + use OC\Files\Cache\Cache; use OC\Files\Storage\Storage; use OC\Files\View; /** - * Class Test_Files_Sharing_Permissions + * Class PermissionsTest * * @group DB */ -class Test_Files_Sharing_Permissions extends OCA\Files_sharing\Tests\TestCase { +class PermissionsTest extends TestCase { /** @var Storage */ private $sharedStorageRestrictedShare; diff --git a/apps/files_sharing/tests/propagationtestcase.php b/apps/files_sharing/tests/PropagationTestCase.php similarity index 98% rename from apps/files_sharing/tests/propagationtestcase.php rename to apps/files_sharing/tests/PropagationTestCase.php index 159a7b859a..1eec2093f7 100644 --- a/apps/files_sharing/tests/propagationtestcase.php +++ b/apps/files_sharing/tests/PropagationTestCase.php @@ -19,7 +19,7 @@ * */ -namespace OCA\Files_sharing\Tests; +namespace OCA\Files_Sharing\Tests; abstract class PropagationTestCase extends TestCase { /** diff --git a/apps/files_sharing/tests/share.php b/apps/files_sharing/tests/ShareTest.php similarity index 95% rename from apps/files_sharing/tests/share.php rename to apps/files_sharing/tests/ShareTest.php index 7707cca190..b4ebfde88e 100644 --- a/apps/files_sharing/tests/share.php +++ b/apps/files_sharing/tests/ShareTest.php @@ -24,14 +24,14 @@ * */ -use OCA\Files\Share; +namespace OCA\Files_Sharing\Tests; /** - * Class Test_Files_Sharing + * Class ShareTest * * @group DB */ -class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { +class ShareTest extends TestCase { const TEST_FOLDER_NAME = '/folder_share_api_test'; @@ -112,7 +112,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { } /** - * @param OC\Files\FileInfo[] $content + * @param \OC\Files\FileInfo[] $content * @param string[] $expected */ public function verifyDirContent($content, $expected) { @@ -240,10 +240,10 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase { \OCP\Constants::PERMISSION_READ ); - $this->loginHelper(\Test_Files_Sharing::TEST_FILES_SHARING_API_USER2); + $this->loginHelper(self::TEST_FILES_SHARING_API_USER2); $info = \OC\Files\Filesystem::getFileInfo($this->filename); - $this->assertSame(\Test_Files_Sharing::TEST_FILES_SHARING_API_USER1, $info->getOwner()->getUID()); + $this->assertSame(self::TEST_FILES_SHARING_API_USER1, $info->getOwner()->getUID()); } } diff --git a/apps/files_sharing/tests/sharedmount.php b/apps/files_sharing/tests/SharedMountTest.php similarity index 99% rename from apps/files_sharing/tests/sharedmount.php rename to apps/files_sharing/tests/SharedMountTest.php index 48040ab8dc..300291357b 100644 --- a/apps/files_sharing/tests/sharedmount.php +++ b/apps/files_sharing/tests/SharedMountTest.php @@ -25,12 +25,14 @@ * */ +namespace OCA\Files_Sharing\Tests; + /** - * Class Test_Files_Sharing_Api + * Class SharedMountTest * * @group DB */ -class Test_Files_Sharing_Mount extends OCA\Files_sharing\Tests\TestCase { +class SharedMountTest extends TestCase { protected function setUp() { parent::setUp(); diff --git a/apps/files_sharing/tests/sharedstorage.php b/apps/files_sharing/tests/SharedStorageTest.php similarity index 99% rename from apps/files_sharing/tests/sharedstorage.php rename to apps/files_sharing/tests/SharedStorageTest.php index 19edc44f9b..6d9eaf6c34 100644 --- a/apps/files_sharing/tests/sharedstorage.php +++ b/apps/files_sharing/tests/SharedStorageTest.php @@ -24,14 +24,14 @@ * */ -use OCA\Files\Share; +namespace OCA\Files_Sharing\Tests; /** - * Class Test_Files_Sharing_Api + * Class SharedStorageTest * * @group DB */ -class Test_Files_Sharing_Storage extends OCA\Files_sharing\Tests\TestCase { +class SharedStorageTest extends TestCase { protected function setUp() { parent::setUp(); diff --git a/apps/files_sharing/tests/sizepropagation.php b/apps/files_sharing/tests/SizePropagationTest.php similarity index 96% rename from apps/files_sharing/tests/sizepropagation.php rename to apps/files_sharing/tests/SizePropagationTest.php index c0f5696c16..b96532b7f3 100644 --- a/apps/files_sharing/tests/sizepropagation.php +++ b/apps/files_sharing/tests/SizePropagationTest.php @@ -21,20 +21,20 @@ * */ -namespace OCA\Files_sharing\Tests; +namespace OCA\Files_Sharing\Tests; use OC\Files\View; use Test\Traits\MountProviderTrait; use Test\Traits\UserTrait; /** - * Class SizePropagation + * Class SizePropagationTest * * @group DB * - * @package OCA\Files_sharing\Tests + * @package OCA\Files_Sharing\Tests */ -class SizePropagation extends TestCase { +class SizePropagationTest extends TestCase { use UserTrait; use MountProviderTrait; diff --git a/apps/files_sharing/tests/testcase.php b/apps/files_sharing/tests/TestCase.php similarity index 99% rename from apps/files_sharing/tests/testcase.php rename to apps/files_sharing/tests/TestCase.php index 9078a3d457..a5c412639e 100644 --- a/apps/files_sharing/tests/testcase.php +++ b/apps/files_sharing/tests/TestCase.php @@ -31,11 +31,10 @@ namespace OCA\Files_Sharing\Tests; use OC\Files\Filesystem; -use OCA\Files\Share; use OCA\Files_Sharing\AppInfo\Application; /** - * Class Test_Files_Sharing_Base + * Class TestCase * * @group DB * diff --git a/apps/files_sharing/tests/unsharechildren.php b/apps/files_sharing/tests/UnshareChildrenTest.php similarity index 95% rename from apps/files_sharing/tests/unsharechildren.php rename to apps/files_sharing/tests/UnshareChildrenTest.php index 6104dc9808..63e4428a25 100644 --- a/apps/files_sharing/tests/unsharechildren.php +++ b/apps/files_sharing/tests/UnshareChildrenTest.php @@ -23,18 +23,16 @@ * */ -namespace OCA\Files_sharing\Tests; - -use OCA\Files\Share; +namespace OCA\Files_Sharing\Tests; /** - * Class UnshareChildren + * Class UnshareChildrenTest * * @group DB * - * @package OCA\Files_sharing\Tests + * @package OCA\Files_Sharing\Tests */ -class UnshareChildren extends TestCase { +class UnshareChildrenTest extends TestCase { protected $subsubfolder; diff --git a/apps/files_sharing/tests/updater.php b/apps/files_sharing/tests/UpdaterTest.php similarity index 98% rename from apps/files_sharing/tests/updater.php rename to apps/files_sharing/tests/UpdaterTest.php index 53e7fc4766..659c04ad98 100644 --- a/apps/files_sharing/tests/updater.php +++ b/apps/files_sharing/tests/UpdaterTest.php @@ -24,13 +24,14 @@ * */ +namespace OCA\Files_Sharing\Tests; /** - * Class Test_Files_Sharing_Updater + * Class UpdaterTest * * @group DB */ -class Test_Files_Sharing_Updater extends OCA\Files_Sharing\Tests\TestCase { +class UpdaterTest extends TestCase { const TEST_FOLDER_NAME = '/folder_share_updater_test'; diff --git a/apps/files_sharing/tests/watcher.php b/apps/files_sharing/tests/WatcherTest.php similarity index 98% rename from apps/files_sharing/tests/watcher.php rename to apps/files_sharing/tests/WatcherTest.php index 19e1bc0b61..512381cf1d 100644 --- a/apps/files_sharing/tests/watcher.php +++ b/apps/files_sharing/tests/WatcherTest.php @@ -25,12 +25,14 @@ * */ +namespace OCA\Files_Sharing\Tests; + /** - * Class Test_Files_Sharing_Watcher + * Class WatcherTest * * @group DB */ -class Test_Files_Sharing_Watcher extends OCA\Files_sharing\Tests\TestCase { +class WatcherTest extends TestCase { /** @var \OC\Files\Storage\Storage */ private $ownerStorage;