Disable trashbin when testing orphaned shares deletion job

This commit is contained in:
Vincent Petry 2015-04-08 13:04:06 +02:00
parent 9c3893ce69
commit 4acf6747d2
1 changed files with 17 additions and 0 deletions

View File

@ -26,6 +26,11 @@ use OCA\Files_sharing\Lib\DeleteOrphanedSharesJob;
class DeleteOrphanedSharesJobTest extends \Test\TestCase { class DeleteOrphanedSharesJobTest extends \Test\TestCase {
/**
* @var bool
*/
private static $trashBinStatus;
/** /**
* @var DeleteOrphanedSharesJob * @var DeleteOrphanedSharesJob
*/ */
@ -46,6 +51,18 @@ class DeleteOrphanedSharesJobTest extends \Test\TestCase {
*/ */
private $user2; 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() { protected function setup() {
parent::setUp(); parent::setUp();