aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/IntegrityCheck/CheckerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/IntegrityCheck/CheckerTest.php')
-rw-r--r--tests/lib/IntegrityCheck/CheckerTest.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/lib/IntegrityCheck/CheckerTest.php b/tests/lib/IntegrityCheck/CheckerTest.php
index 8414a531464..a8a2596a3d8 100644
--- a/tests/lib/IntegrityCheck/CheckerTest.php
+++ b/tests/lib/IntegrityCheck/CheckerTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -8,6 +9,7 @@
namespace Test\IntegrityCheck;
use OC\Core\Command\Maintenance\Mimetype\GenerateMimetypeFileBuilder;
+use OC\Files\Type\Detection;
use OC\IntegrityCheck\Checker;
use OC\IntegrityCheck\Helpers\AppLocator;
use OC\IntegrityCheck\Helpers\EnvironmentHelper;
@@ -54,7 +56,7 @@ class CheckerTest extends TestCase {
$this->appConfig = $this->createMock(IAppConfig::class);
$this->cacheFactory = $this->createMock(ICacheFactory::class);
$this->appManager = $this->createMock(IAppManager::class);
- $this->mimeTypeDetector = $this->createMock(\OC\Files\Type\Detection::class);
+ $this->mimeTypeDetector = $this->createMock(Detection::class);
$this->config->method('getAppValue')
->willReturnArgument(2);
@@ -111,7 +113,7 @@ class CheckerTest extends TestCase {
$this->fileAccessHelper
->expects($this->once())
->method('file_put_contents')
- ->will($this->throwException(new \Exception('Exception message')));
+ ->willThrowException(new \Exception('Exception message'));
$keyBundle = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.crt');
$rsaPrivateKey = file_get_contents(__DIR__ . '/../../data/integritycheck/SomeApp.key');
@@ -445,7 +447,7 @@ class CheckerTest extends TestCase {
$this->fileAccessHelper
->expects($this->once())
->method('assertDirectoryExists')
- ->will($this->throwException(new \Exception('Exception message')));
+ ->willThrowException(new \Exception('Exception message'));
$this->fileAccessHelper
->expects($this->once())
->method('is_writable')
@@ -469,7 +471,7 @@ class CheckerTest extends TestCase {
$this->fileAccessHelper
->expects($this->once())
->method('assertDirectoryExists')
- ->will($this->throwException(new \Exception('Exception message')));
+ ->willThrowException(new \Exception('Exception message'));
$this->fileAccessHelper
->expects($this->once())
->method('is_writable')
@@ -1077,8 +1079,8 @@ class CheckerTest extends TestCase {
/**
* @param string $channel
* @param bool $isCodeSigningEnforced
- * @dataProvider channelDataProvider
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('channelDataProvider')]
public function testIsCodeCheckEnforced($channel, $isCodeSigningEnforced): void {
$this->serverVersion
->expects($this->once())
@@ -1095,8 +1097,8 @@ class CheckerTest extends TestCase {
/**
* @param string $channel
- * @dataProvider channelDataProvider
*/
+ #[\PHPUnit\Framework\Attributes\DataProvider('channelDataProvider')]
public function testIsCodeCheckEnforcedWithDisabledConfigSwitch($channel): void {
$this->serverVersion
->expects($this->once())