diff options
Diffstat (limited to 'tests/Core/Command/Config/ListConfigsTest.php')
-rw-r--r-- | tests/Core/Command/Config/ListConfigsTest.php | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/tests/Core/Command/Config/ListConfigsTest.php b/tests/Core/Command/Config/ListConfigsTest.php index 0cee870d45c..e4af55116c0 100644 --- a/tests/Core/Command/Config/ListConfigsTest.php +++ b/tests/Core/Command/Config/ListConfigsTest.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -7,6 +8,7 @@ namespace Tests\Core\Command\Config; +use OC\Config\ConfigManager; use OC\Core\Command\Config\ListConfigs; use OC\SystemConfig; use OCP\IAppConfig; @@ -20,6 +22,8 @@ class ListConfigsTest extends TestCase { protected $appConfig; /** @var \PHPUnit\Framework\MockObject\MockObject */ protected $systemConfig; + /** @var \PHPUnit\Framework\MockObject\MockObject */ + protected $configManager; /** @var \PHPUnit\Framework\MockObject\MockObject */ protected $consoleInput; @@ -38,15 +42,20 @@ class ListConfigsTest extends TestCase { $appConfig = $this->appConfig = $this->getMockBuilder(IAppConfig::class) ->disableOriginalConstructor() ->getMock(); + $configManager = $this->configManager = $this->getMockBuilder(ConfigManager::class) + ->disableOriginalConstructor() + ->getMock(); + $this->consoleInput = $this->getMockBuilder(InputInterface::class)->getMock(); $this->consoleOutput = $this->getMockBuilder(OutputInterface::class)->getMock(); /** @var \OC\SystemConfig $systemConfig */ /** @var \OCP\IAppConfig $appConfig */ - $this->command = new ListConfigs($systemConfig, $appConfig); + /** @var ConfigManager $configManager */ + $this->command = new ListConfigs($systemConfig, $appConfig, $configManager); } - public function listData() { + public static function listData(): array { return [ [ 'all', @@ -61,10 +70,10 @@ class ListConfigsTest extends TestCase { ], // app config [ - ['files', false, [ + ['files', [ 'enabled' => 'yes', ]], - ['core', false, [ + ['core', [ 'global_cache_gc_lastrun' => '1430388388', ]], ], @@ -141,10 +150,10 @@ class ListConfigsTest extends TestCase { ], // app config [ - ['files', false, [ + ['files', [ 'enabled' => 'yes', ]], - ['core', false, [ + ['core', [ 'global_cache_gc_lastrun' => '1430388388', ]], ], @@ -176,10 +185,10 @@ class ListConfigsTest extends TestCase { ], // app config [ - ['files', false, [ + ['files', [ 'enabled' => 'yes', ]], - ['core', false, [ + ['core', [ 'global_cache_gc_lastrun' => '1430388388', ]], ], @@ -204,10 +213,10 @@ class ListConfigsTest extends TestCase { ], // app config [ - ['files', false, [ + ['files', [ 'enabled' => 'yes', ]], - ['core', false, [ + ['core', [ 'global_cache_gc_lastrun' => '1430388388', ]], ], @@ -253,7 +262,6 @@ class ListConfigsTest extends TestCase { } /** - * @dataProvider listData * * @param string $app * @param array $systemConfigs @@ -262,6 +270,7 @@ class ListConfigsTest extends TestCase { * @param bool $private * @param string $expected */ + #[\PHPUnit\Framework\Attributes\DataProvider('listData')] public function testList($app, $systemConfigs, $systemConfigMap, $appConfig, $private, $expected): void { $this->systemConfig->expects($this->any()) ->method('getKeys') |