diff options
Diffstat (limited to 'apps/encryption/tests/Command/TestEnableMasterKey.php')
-rw-r--r-- | apps/encryption/tests/Command/TestEnableMasterKey.php | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/apps/encryption/tests/Command/TestEnableMasterKey.php b/apps/encryption/tests/Command/TestEnableMasterKey.php index 269e99eae4b..ead3dfd0195 100644 --- a/apps/encryption/tests/Command/TestEnableMasterKey.php +++ b/apps/encryption/tests/Command/TestEnableMasterKey.php @@ -1,26 +1,11 @@ <?php + +declare(strict_types=1); + /** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Björn Schießle <bjoern@schiessle.org> - * @author Joas Schilling <coding@schilljs.com> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * + * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-only */ namespace OCA\Encryption\Tests\Command; @@ -34,22 +19,22 @@ use Test\TestCase; class TestEnableMasterKey extends TestCase { - /** @var EnableMasterKey */ + /** @var EnableMasterKey */ protected $enableMasterKey; - /** @var Util | \PHPUnit\Framework\MockObject\MockObject */ + /** @var Util | \PHPUnit\Framework\MockObject\MockObject */ protected $util; - /** @var \OCP\IConfig | \PHPUnit\Framework\MockObject\MockObject */ + /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */ protected $config; /** @var \Symfony\Component\Console\Helper\QuestionHelper | \PHPUnit\Framework\MockObject\MockObject */ protected $questionHelper; - /** @var \Symfony\Component\Console\Output\OutputInterface | \PHPUnit\Framework\MockObject\MockObject */ + /** @var \Symfony\Component\Console\Output\OutputInterface | \PHPUnit\Framework\MockObject\MockObject */ protected $output; - /** @var \Symfony\Component\Console\Input\InputInterface | \PHPUnit\Framework\MockObject\MockObject */ + /** @var \Symfony\Component\Console\Input\InputInterface | \PHPUnit\Framework\MockObject\MockObject */ protected $input; protected function setUp(): void { @@ -70,12 +55,12 @@ class TestEnableMasterKey extends TestCase { } /** - * @dataProvider dataTestExecute * * @param bool $isAlreadyEnabled * @param string $answer */ - public function testExecute($isAlreadyEnabled, $answer) { + #[\PHPUnit\Framework\Attributes\DataProvider('dataTestExecute')] + public function testExecute($isAlreadyEnabled, $answer): void { $this->util->expects($this->once())->method('isMasterKeyEnabled') ->willReturn($isAlreadyEnabled); @@ -96,7 +81,7 @@ class TestEnableMasterKey extends TestCase { $this->invokePrivate($this->enableMasterKey, 'execute', [$this->input, $this->output]); } - public function dataTestExecute() { + public static function dataTestExecute() { return [ [true, ''], [false, 'y'], |