diff options
Diffstat (limited to 'tests/Core/Command/Apps/AppsEnableTest.php')
-rw-r--r-- | tests/Core/Command/Apps/AppsEnableTest.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/Core/Command/Apps/AppsEnableTest.php b/tests/Core/Command/Apps/AppsEnableTest.php index 228c09364bf..604c670ae15 100644 --- a/tests/Core/Command/Apps/AppsEnableTest.php +++ b/tests/Core/Command/Apps/AppsEnableTest.php @@ -9,6 +9,10 @@ declare(strict_types=1); namespace Tests\Core\Command\Config; use OC\Core\Command\App\Enable; +use OC\Installer; +use OCP\App\IAppManager; +use OCP\IGroupManager; +use OCP\Server; use Symfony\Component\Console\Tester\CommandTester; use Test\TestCase; @@ -25,23 +29,24 @@ class AppsEnableTest extends TestCase { parent::setUp(); $command = new Enable( - \OC::$server->getAppManager(), - \OC::$server->getGroupManager() + Server::get(IAppManager::class), + Server::get(IGroupManager::class), + Server::get(Installer::class), ); $this->commandTester = new CommandTester($command); - \OC::$server->getAppManager()->disableApp('admin_audit'); - \OC::$server->getAppManager()->disableApp('comments'); + Server::get(IAppManager::class)->disableApp('admin_audit'); + Server::get(IAppManager::class)->disableApp('comments'); } /** - * @dataProvider dataCommandInput * @param $appId * @param $groups * @param $statusCode * @param $pattern */ + #[\PHPUnit\Framework\Attributes\DataProvider('dataCommandInput')] public function testCommandInput($appId, $groups, $statusCode, $pattern): void { $input = ['app-id' => $appId]; @@ -55,7 +60,7 @@ class AppsEnableTest extends TestCase { $this->assertSame($statusCode, $this->commandTester->getStatusCode()); } - public function dataCommandInput(): array { + public static function dataCommandInput(): array { return [ [['admin_audit'], null, 0, 'admin_audit ([\d\.]*) enabled'], [['comments'], null, 0, 'comments ([\d\.]*) enabled'], |