aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/tests/Backend/LegacyBackendTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external/tests/Backend/LegacyBackendTest.php')
-rw-r--r--apps/files_external/tests/Backend/LegacyBackendTest.php18
1 files changed, 8 insertions, 10 deletions
diff --git a/apps/files_external/tests/Backend/LegacyBackendTest.php b/apps/files_external/tests/Backend/LegacyBackendTest.php
index cea46c1a0cd..c4ddfedf6e2 100644
--- a/apps/files_external/tests/Backend/LegacyBackendTest.php
+++ b/apps/files_external/tests/Backend/LegacyBackendTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -6,6 +7,7 @@
*/
namespace OCA\Files_External\Tests\Backend;
+use OCA\Files_External\Lib\Auth\Builtin;
use OCA\Files_External\Lib\Backend\LegacyBackend;
use OCA\Files_External\Lib\DefinitionParameter;
use OCA\Files_External\Lib\MissingDependency;
@@ -15,18 +17,16 @@ class LegacyBackendTest extends \Test\TestCase {
/**
* @return MissingDependency[]
*/
- public static function checkDependencies() {
+ public static function checkDependencies(): array {
return [
(new MissingDependency('abc'))->setMessage('foobar')
];
}
public function testConstructor(): void {
- $auth = $this->getMockBuilder('\OCA\Files_External\Lib\Auth\Builtin')
- ->disableOriginalConstructor()
- ->getMock();
+ $auth = $this->createMock(Builtin::class);
- $class = '\OCA\Files_External\Tests\Backend\LegacyBackendTest';
+ $class = self::class;
$definition = [
'configuration' => [
'textfield' => 'Text field',
@@ -43,7 +43,7 @@ class LegacyBackendTest extends \Test\TestCase {
$backend = new LegacyBackend($class, $definition, $auth);
- $this->assertEquals('\OCA\Files_External\Tests\Backend\LegacyBackendTest', $backend->getStorageClass());
+ $this->assertEquals(self::class, $backend->getStorageClass());
$this->assertEquals('Backend text', $backend->getText());
$this->assertEquals(123, $backend->getPriority());
$this->assertContains('foo/bar.js', $backend->getCustomJs());
@@ -74,11 +74,9 @@ class LegacyBackendTest extends \Test\TestCase {
}
public function testNoDependencies(): void {
- $auth = $this->getMockBuilder('\OCA\Files_External\Lib\Auth\Builtin')
- ->disableOriginalConstructor()
- ->getMock();
+ $auth = $this->createMock(Builtin::class);
- $class = '\OCA\Files_External\Tests\Backend\LegacyBackendTest';
+ $class = self::class;
$definition = [
'configuration' => [
],