Browse Source

Merge pull request #24661 from owncloud/files_sharing-psr4

Move Files_Sharing to PSR-4
remotes/origin/add-frame-ancestor-csp
Vincent Petry 10 years ago
parent
commit
d22aeb749d
  1. 0
      apps/federatedfilesharing/lib/Notifier.php
  2. 4
      apps/files_sharing/appinfo/app.php
  3. 6
      apps/files_sharing/appinfo/info.xml
  4. 3
      apps/files_sharing/appinfo/routes.php
  5. 0
      apps/files_sharing/lib/API/OCSShareWrapper.php
  6. 0
      apps/files_sharing/lib/API/Remote.php
  7. 0
      apps/files_sharing/lib/API/Share20OCS.php
  8. 0
      apps/files_sharing/lib/API/Sharees.php
  9. 0
      apps/files_sharing/lib/Activity.php
  10. 0
      apps/files_sharing/lib/AppInfo/Application.php
  11. 0
      apps/files_sharing/lib/Cache.php
  12. 0
      apps/files_sharing/lib/Capabilities.php
  13. 0
      apps/files_sharing/lib/Controllers/ExternalSharesController.php
  14. 0
      apps/files_sharing/lib/Controllers/ShareController.php
  15. 2
      apps/files_sharing/lib/DeleteOrphanedSharesJob.php
  16. 0
      apps/files_sharing/lib/Exceptions/BrokenPath.php
  17. 0
      apps/files_sharing/lib/Exceptions/S2SException.php
  18. 0
      apps/files_sharing/lib/ExpireSharesJob.php
  19. 0
      apps/files_sharing/lib/External/Cache.php
  20. 0
      apps/files_sharing/lib/External/Manager.php
  21. 0
      apps/files_sharing/lib/External/Mount.php
  22. 0
      apps/files_sharing/lib/External/MountProvider.php
  23. 0
      apps/files_sharing/lib/External/Scanner.php
  24. 0
      apps/files_sharing/lib/External/Storage.php
  25. 0
      apps/files_sharing/lib/Helper.php
  26. 0
      apps/files_sharing/lib/Hooks.php
  27. 0
      apps/files_sharing/lib/ISharedStorage.php
  28. 0
      apps/files_sharing/lib/Maintainer.php
  29. 0
      apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php
  30. 0
      apps/files_sharing/lib/Migration.php
  31. 0
      apps/files_sharing/lib/MountProvider.php
  32. 0
      apps/files_sharing/lib/Scanner.php
  33. 0
      apps/files_sharing/lib/SharedMount.php
  34. 0
      apps/files_sharing/lib/SharedPropagator.php
  35. 0
      apps/files_sharing/lib/Updater.php
  36. 0
      apps/files_sharing/tests/API/Share20OCSTest.php
  37. 2
      apps/files_sharing/tests/API/ShareesTest.php
  38. 8
      apps/files_sharing/tests/ActivityTest.php
  39. 63
      apps/files_sharing/tests/ApiTest.php
  40. 8
      apps/files_sharing/tests/BackendTest.php
  41. 8
      apps/files_sharing/tests/CacheTest.php
  42. 4
      apps/files_sharing/tests/CapabilitiesTest.php
  43. 4
      apps/files_sharing/tests/Controllers/ExternalShareControllerTest.php
  44. 5
      apps/files_sharing/tests/Controllers/ShareControllerTest.php
  45. 6
      apps/files_sharing/tests/DeleteOrphanedSharesJobTest.php
  46. 4
      apps/files_sharing/tests/EncryptedSizePropagationTest.php
  47. 8
      apps/files_sharing/tests/EtagPropagationTest.php
  48. 0
      apps/files_sharing/tests/ExpireSharesJobTest.php
  49. 8
      apps/files_sharing/tests/External/CacheTest.php
  50. 0
      apps/files_sharing/tests/External/ManagerTest.php
  51. 0
      apps/files_sharing/tests/External/ScannerTest.php
  52. 4
      apps/files_sharing/tests/ExternalStorageTest.php
  53. 6
      apps/files_sharing/tests/GroupEtagPropagationTest.php
  54. 7
      apps/files_sharing/tests/HelperTest.php
  55. 8
      apps/files_sharing/tests/LockingTest.php
  56. 0
      apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php
  57. 3
      apps/files_sharing/tests/MigrationTest.php
  58. 8
      apps/files_sharing/tests/PermissionsTest.php
  59. 2
      apps/files_sharing/tests/PropagationTestCase.php
  60. 12
      apps/files_sharing/tests/ShareTest.php
  61. 6
      apps/files_sharing/tests/SharedMountTest.php
  62. 6
      apps/files_sharing/tests/SharedStorageTest.php
  63. 8
      apps/files_sharing/tests/SizePropagationTest.php
  64. 5
      apps/files_sharing/tests/TestCase.php
  65. 10
      apps/files_sharing/tests/UnshareChildrenTest.php
  66. 5
      apps/files_sharing/tests/UpdaterTest.php
  67. 6
      apps/files_sharing/tests/WatcherTest.php
  68. 2
      lib/private/Repair/DropOldJobs.php

0
apps/federatedfilesharing/lib/notifier.php → apps/federatedfilesharing/lib/Notifier.php

4
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();

6
apps/files_sharing/appinfo/info.xml

@ -21,8 +21,10 @@ Turning the feature off removes shared files and folders on the server for all s
<files>public.php</files>
</public>
<namespace>Files_Sharing</namespace>
<background-jobs>
<job>OCA\Files_sharing\Lib\DeleteOrphanedSharesJob</job>
<job>OCA\Files_sharing\ExpireSharesJob</job>
<job>OCA\Files_Sharing\DeleteOrphanedSharesJob</job>
<job>OCA\Files_Sharing\ExpireSharesJob</job>
</background-jobs>
</info>

3
apps/files_sharing/appinfo/routes.php

@ -24,11 +24,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
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'],

0
apps/files_sharing/api/ocssharewrapper.php → apps/files_sharing/lib/API/OCSShareWrapper.php

0
apps/files_sharing/api/remote.php → apps/files_sharing/lib/API/Remote.php

0
apps/files_sharing/api/share20ocs.php → apps/files_sharing/lib/API/Share20OCS.php

0
apps/files_sharing/api/sharees.php → apps/files_sharing/lib/API/Sharees.php

0
apps/files_sharing/lib/activity.php → apps/files_sharing/lib/Activity.php

0
apps/files_sharing/appinfo/application.php → apps/files_sharing/lib/AppInfo/Application.php

0
apps/files_sharing/lib/cache.php → apps/files_sharing/lib/Cache.php

0
apps/files_sharing/lib/capabilities.php → apps/files_sharing/lib/Capabilities.php

0
apps/files_sharing/lib/controllers/externalsharescontroller.php → apps/files_sharing/lib/Controllers/ExternalSharesController.php

0
apps/files_sharing/lib/controllers/sharecontroller.php → apps/files_sharing/lib/Controllers/ShareController.php

2
apps/files_sharing/lib/deleteorphanedsharesjob.php → apps/files_sharing/lib/DeleteOrphanedSharesJob.php

@ -20,7 +20,7 @@
*
*/
namespace OCA\Files_sharing\Lib;
namespace OCA\Files_Sharing;
use OC\BackgroundJob\TimedJob;

0
apps/files_sharing/lib/exceptions/brokenpath.php → apps/files_sharing/lib/Exceptions/BrokenPath.php

0
apps/files_sharing/lib/exceptions/s2sexception.php → apps/files_sharing/lib/Exceptions/S2SException.php

0
apps/files_sharing/lib/expiresharesjob.php → apps/files_sharing/lib/ExpireSharesJob.php

0
apps/files_sharing/lib/external/cache.php → apps/files_sharing/lib/External/Cache.php

0
apps/files_sharing/lib/external/manager.php → apps/files_sharing/lib/External/Manager.php

0
apps/files_sharing/lib/external/mount.php → apps/files_sharing/lib/External/Mount.php

0
apps/files_sharing/lib/external/mountprovider.php → apps/files_sharing/lib/External/MountProvider.php

0
apps/files_sharing/lib/external/scanner.php → apps/files_sharing/lib/External/Scanner.php

0
apps/files_sharing/lib/external/storage.php → apps/files_sharing/lib/External/Storage.php

0
apps/files_sharing/lib/helper.php → apps/files_sharing/lib/Helper.php

0
apps/files_sharing/lib/hooks.php → apps/files_sharing/lib/Hooks.php

0
apps/files_sharing/lib/isharedstorage.php → apps/files_sharing/lib/ISharedStorage.php

0
apps/files_sharing/lib/maintainer.php → apps/files_sharing/lib/Maintainer.php

0
apps/files_sharing/lib/middleware/sharingcheckmiddleware.php → apps/files_sharing/lib/Middleware/SharingCheckMiddleware.php

0
apps/files_sharing/lib/migration.php → apps/files_sharing/lib/Migration.php

0
apps/files_sharing/lib/mountprovider.php → apps/files_sharing/lib/MountProvider.php

0
apps/files_sharing/lib/scanner.php → apps/files_sharing/lib/Scanner.php

0
apps/files_sharing/lib/sharedmount.php → apps/files_sharing/lib/SharedMount.php

0
apps/files_sharing/lib/sharedpropagator.php → apps/files_sharing/lib/SharedPropagator.php

0
apps/files_sharing/lib/updater.php → apps/files_sharing/lib/Updater.php

0
apps/files_sharing/tests/api/share20ocstest.php → apps/files_sharing/tests/API/Share20OCSTest.php

2
apps/files_sharing/tests/api/shareestest.php → 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;

8
apps/files_sharing/tests/activity.php → 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

63
apps/files_sharing/tests/api.php → 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');

8
apps/files_sharing/tests/backend.php → 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';

8
apps/files_sharing/tests/cache.php → apps/files_sharing/tests/CacheTest.php

@ -24,18 +24,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
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;

4
apps/files_sharing/tests/capabilities.php → 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.

4
apps/files_sharing/tests/controller/externalsharecontroller.php → 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')

5
apps/files_sharing/tests/controller/sharecontroller.php → 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() {

6
apps/files_sharing/tests/deleteorphanedsharesjobtest.php → 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 {

4
apps/files_sharing/tests/encryptedsizepropagation.php → 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 = '') {

8
apps/files_sharing/tests/etagpropagation.php → 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"

0
apps/files_sharing/tests/expiresharesjobtest.php → apps/files_sharing/tests/ExpireSharesJobTest.php

8
apps/files_sharing/tests/external/cache.php → apps/files_sharing/tests/External/CacheTest.php

@ -20,18 +20,18 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
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

0
apps/files_sharing/tests/external/managertest.php → apps/files_sharing/tests/External/ManagerTest.php

0
apps/files_sharing/tests/external/scannertest.php → apps/files_sharing/tests/External/ScannerTest.php

4
apps/files_sharing/tests/externalstorage.php → 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(

6
apps/files_sharing/tests/groupetagpropagation.php → 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

7
apps/files_sharing/tests/helper.php → apps/files_sharing/tests/HelperTest.php

@ -20,14 +20,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
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

8
apps/files_sharing/tests/locking.php → 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
*/

0
apps/files_sharing/tests/middleware/sharingcheckmiddleware.php → apps/files_sharing/tests/Middleware/SharingCheckMiddlewareTest.php

3
apps/files_sharing/tests/migrationtest.php → 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;
/**

8
apps/files_sharing/tests/permissions.php → apps/files_sharing/tests/PermissionsTest.php

@ -22,16 +22,20 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
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;

2
apps/files_sharing/tests/propagationtestcase.php → 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 {
/**

12
apps/files_sharing/tests/share.php → 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());
}
}

6
apps/files_sharing/tests/sharedmount.php → 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();

6
apps/files_sharing/tests/sharedstorage.php → 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();

8
apps/files_sharing/tests/sizepropagation.php → 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;

5
apps/files_sharing/tests/testcase.php → 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;
use OCA\Files_Sharing\AppInfo\Application;
/**
* Class Test_Files_Sharing_Base
* Class TestCase
*
* @group DB
*

10
apps/files_sharing/tests/unsharechildren.php → 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;

5
apps/files_sharing/tests/updater.php → 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';

6
apps/files_sharing/tests/watcher.php → 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;

2
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],
];
}

Loading…
Cancel
Save