*/
function testDeleteParentFolder() {
$status = \OC_App::isEnabled('files_trashbin');
- \OC_App::enable('files_trashbin');
+ (new \OC_App())->enable('files_trashbin');
+
\OCA\Files_Trashbin\Trashbin::registerHooks();
}
$groups = $input->getOption('groups');
+ $appClass = new \OC_App();
if (empty($groups)) {
- \OC_App::enable($appId);
+ $appClass->enable($appId);
$output->writeln($appId . ' enabled');
} else {
- \OC_App::enable($appId, $groups);
+ $appClass->enable($appId, $groups);
$output->writeln($appId . ' enabled for groups: ' . implode(', ', $groups));
}
return 0;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\ICacheFactory;
+use OCP\L10N\IFactory;
use Test\TestCase;
use OCP\IRequest;
use OCP\IL10N;
private $categoryFetcher;
/** @var AppFetcher|\PHPUnit_Framework_MockObject_MockObject */
private $appFetcher;
+ /** @var IFactory|\PHPUnit_Framework_MockObject_MockObject */
+ private $l10nFactory;
public function setUp() {
parent::setUp();
$this->appManager = $this->createMock(IAppManager::class);
$this->categoryFetcher = $this->createMock(CategoryFetcher::class);
$this->appFetcher = $this->createMock(AppFetcher::class);
+ $this->l10nFactory = $this->createMock(IFactory::class);
$this->appSettingsController = new AppSettingsController(
'settings',
$this->navigationManager,
$this->appManager,
$this->categoryFetcher,
- $this->appFetcher
+ $this->appFetcher,
+ $this->l10nFactory
);
}
function enableApp($app) {
try {
- OC_App::enable($app);
+ (new \OC_App())->enable($app);
} catch (Exception $e) {
echo $e;
}
]
);
- Installer::installApp($data);
+ $installer = new Installer();
+ $installer->installApp($data);
$isInstalled = Installer::isInstalled(self::$appid);
$this->assertTrue($isInstalled);
]
);
- Installer::installApp($oldData);
+ $installer = new Installer();
+ $installer->installApp($oldData);
$oldVersionNumber = \OC_App::getAppVersion(self::$appid);
Installer::updateApp($newData);
public static function tearDownAfterClass() {
if (self::$trashBinStatus) {
- \OC_App::enable('files_trashbin');
+ (new \OC_App())->enable('files_trashbin');
}
}