diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-07-22 22:11:01 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2020-07-23 22:03:14 +0200 |
commit | e84504c4d6a079d55d2f78ad21b1ad20d53035bb (patch) | |
tree | b1ac43a8573169257ee0c8d56d1dfd406cf68f59 /apps/files_trashbin/tests | |
parent | c842678f0a1fb65981a03302895192ddc58479c9 (diff) | |
download | nextcloud-server-e84504c4d6a079d55d2f78ad21b1ad20d53035bb.tar.gz nextcloud-server-e84504c4d6a079d55d2f78ad21b1ad20d53035bb.zip |
Use IBootstrap for the files_trashbin app
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_trashbin/tests')
-rw-r--r-- | apps/files_trashbin/tests/StorageTest.php | 6 | ||||
-rw-r--r-- | apps/files_trashbin/tests/TrashbinTest.php | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/apps/files_trashbin/tests/StorageTest.php b/apps/files_trashbin/tests/StorageTest.php index 2efdf1b8958..36628cb08b9 100644 --- a/apps/files_trashbin/tests/StorageTest.php +++ b/apps/files_trashbin/tests/StorageTest.php @@ -34,9 +34,11 @@ namespace OCA\Files_Trashbin\Tests; use OC\Files\Filesystem; use OC\Files\Storage\Temporary; +use OCA\Files_Trashbin\AppInfo\Application; use OCA\Files_Trashbin\Events\MoveToTrashEvent; use OCA\Files_Trashbin\Storage; use OCA\Files_Trashbin\Trash\ITrashManager; +use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Files\Cache\ICache; use OCP\Files\Folder; @@ -75,7 +77,9 @@ class StorageTest extends \Test\TestCase { parent::setUp(); \OC_Hook::clear(); - \OCA\Files_Trashbin\Trashbin::registerHooks(); + // register trashbin hooks + $trashbinApp = new Application(); + $trashbinApp->boot($this->createMock(IBootContext::class)); $this->user = $this->getUniqueId('user'); \OC::$server->getUserManager()->createUser($this->user, $this->user); diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php index 7dfa93bb044..96a76e1e2fe 100644 --- a/apps/files_trashbin/tests/TrashbinTest.php +++ b/apps/files_trashbin/tests/TrashbinTest.php @@ -30,6 +30,9 @@ */ use OCA\Files_Sharing\AppInfo\Application; +use OCA\Files_Trashbin\AppInfo\Application as TrashbinApplication; +use OC\AppFramework\Bootstrap\BootContext; +use OC\AppFramework\DependencyInjection\DIContainer; use OCP\Share\IShare; /** @@ -83,8 +86,9 @@ class TrashbinTest extends \Test\TestCase { $expiration = \OC::$server->query(\OCA\Files_Trashbin\Expiration::class); $expiration->setRetentionObligation('auto, 2'); - // register hooks - \OCA\Files_Trashbin\Trashbin::registerHooks(); + // register trashbin hooks + $trashbinApp = new TrashbinApplication(); + $trashbinApp->boot(new BootContext(new DIContainer('', [], \OC::$server))); // create test user self::loginHelper(self::TEST_TRASHBIN_USER2, true); |