From: Vincent Petry Date: Wed, 8 Apr 2015 11:04:06 +0000 (+0200) Subject: Disable trashbin when testing orphaned shares deletion job X-Git-Tag: v8.1.0alpha1~60^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4acf6747d285bd4a15717c2c6a73c5a308134131;p=nextcloud-server.git Disable trashbin when testing orphaned shares deletion job --- diff --git a/apps/files_sharing/tests/deleteorphanedsharesjobtest.php b/apps/files_sharing/tests/deleteorphanedsharesjobtest.php index ec9d5f089bb..e1c6a6f6ad3 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();