diff options
Diffstat (limited to 'apps/theming/tests/Settings')
-rw-r--r-- | apps/theming/tests/Settings/AdminSectionTest.php | 12 | ||||
-rw-r--r-- | apps/theming/tests/Settings/AdminTest.php | 17 | ||||
-rw-r--r-- | apps/theming/tests/Settings/PersonalTest.php | 13 |
3 files changed, 22 insertions, 20 deletions
diff --git a/apps/theming/tests/Settings/AdminSectionTest.php b/apps/theming/tests/Settings/AdminSectionTest.php index a73eca1cc5a..ecb889f264b 100644 --- a/apps/theming/tests/Settings/AdminSectionTest.php +++ b/apps/theming/tests/Settings/AdminSectionTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -9,15 +11,13 @@ use OCA\Theming\AppInfo\Application; use OCA\Theming\Settings\AdminSection; use OCP\IL10N; use OCP\IURLGenerator; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class AdminSectionTest extends TestCase { - /** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */ - private $url; - /** @var IL10N|\PHPUnit\Framework\MockObject\MockObject */ - private $l; - /** @var AdminSection */ - private $section; + private IURLGenerator&MockObject $url; + private IL10N&MockObject $l; + private AdminSection $section; protected function setUp(): void { parent::setUp(); diff --git a/apps/theming/tests/Settings/AdminTest.php b/apps/theming/tests/Settings/AdminTest.php index 189a91bae3a..277b94900a8 100644 --- a/apps/theming/tests/Settings/AdminTest.php +++ b/apps/theming/tests/Settings/AdminTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -15,17 +17,18 @@ use OCP\IConfig; use OCP\IL10N; use OCP\INavigationManager; use OCP\IURLGenerator; +use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; class AdminTest extends TestCase { private Admin $admin; - private IConfig $config; - private ThemingDefaults $themingDefaults; - private IInitialState $initialState; - private IURLGenerator $urlGenerator; - private ImageManager $imageManager; - private IL10N $l10n; - private INavigationManager $navigationManager; + private IConfig&MockObject $config; + private ThemingDefaults&MockObject $themingDefaults; + private IInitialState&MockObject $initialState; + private IURLGenerator&MockObject $urlGenerator; + private ImageManager&MockObject $imageManager; + private IL10N&MockObject $l10n; + private INavigationManager&MockObject $navigationManager; protected function setUp(): void { parent::setUp(); diff --git a/apps/theming/tests/Settings/PersonalTest.php b/apps/theming/tests/Settings/PersonalTest.php index 4630ef48c8a..9216450ec9c 100644 --- a/apps/theming/tests/Settings/PersonalTest.php +++ b/apps/theming/tests/Settings/PersonalTest.php @@ -1,4 +1,6 @@ <?php + +declare(strict_types=1); /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-License-Identifier: AGPL-3.0-or-later @@ -39,7 +41,7 @@ class PersonalTest extends TestCase { private Personal $admin; /** @var ITheme[] */ - private $themes; + private array $themes; protected function setUp(): void { parent::setUp(); @@ -67,8 +69,7 @@ class PersonalTest extends TestCase { ); } - - public function dataTestGetForm() { + public function dataTestGetForm(): array { return [ ['', [ $this->formatThemeForm('default'), @@ -86,12 +87,10 @@ class PersonalTest extends TestCase { } /** - * @dataProvider dataTestGetForm - * - * @param string $toEnable * @param string[] $enabledThemes */ - public function testGetForm(string $enforcedTheme, $themesState): void { + #[\PHPUnit\Framework\Attributes\DataProvider('dataTestGetForm')] + public function testGetForm(string $enforcedTheme, array $themesState): void { $this->config->expects($this->once()) ->method('getSystemValueString') ->with('enforce_theme', '') |