From 4acf6747d285bd4a15717c2c6a73c5a308134131 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 8 Apr 2015 13:04:06 +0200 Subject: [PATCH] Disable trashbin when testing orphaned shares deletion job --- .../tests/deleteorphanedsharesjobtest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/files_sharing/tests/deleteorphanedsharesjobtest.php b/apps/files_sharing/tests/deleteorphanedsharesjobtest.php index ec9d5f089b..e1c6a6f6ad 100644 --- a/apps/files_sharing/tests/deleteorphanedsharesjobtest.php +++ b/apps/files_sharing/tests/deleteorphanedsharesjobtest.php @@ -26,6 +26,11 @@ use OCA\Files_sharing\Lib\DeleteOrphanedSharesJob; class DeleteOrphanedSharesJobTest extends \Test\TestCase { + /** + * @var bool + */ + private static $trashBinStatus; + /** * @var DeleteOrphanedSharesJob */ @@ -46,6 +51,18 @@ class DeleteOrphanedSharesJobTest extends \Test\TestCase { */ private $user2; + public static function setUpBeforeClass() { + $appManager = \OC::$server->getAppManager(); + self::$trashBinStatus = $appManager->isEnabledForUser('files_trashbin'); + $appManager->disableApp('files_trashbin'); + } + + public static function tearDownAfterClass() { + if (self::$trashBinStatus) { + \OC::$server->getAppManager()->enableApp('files_trashbin'); + } + } + protected function setup() { parent::setUp();