From 9422b6d6d01bc5f533c86f4544ed4e5d1f68f6e5 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Wed, 28 May 2025 10:41:55 +0200 Subject: [PATCH] test: adjust library tests for PHPunit deprecations Signed-off-by: Ferdinand Thiessen --- tests/lib/App/AppManagerTest.php | 6 +++--- tests/lib/Files/FilenameValidatorTest.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/lib/App/AppManagerTest.php b/tests/lib/App/AppManagerTest.php index 2e1163cf9db..c8f7f2cb172 100644 --- a/tests/lib/App/AppManagerTest.php +++ b/tests/lib/App/AppManagerTest.php @@ -159,15 +159,15 @@ class AppManagerTest extends TestCase { } } - public function dataGetAppIcon(): array { + public static function dataGetAppIcon(): array { $nothing = function ($appId) { - $this->assertEquals('test', $appId); + self::assertEquals('test', $appId); throw new \RuntimeException(); }; $createCallback = function ($workingIcons) { return function ($appId, $icon) use ($workingIcons) { - $this->assertEquals('test', $appId); + self::assertEquals('test', $appId); if (in_array($icon, $workingIcons)) { return '/path/' . $icon; } diff --git a/tests/lib/Files/FilenameValidatorTest.php b/tests/lib/Files/FilenameValidatorTest.php index db7874b0bd5..a52971d109e 100644 --- a/tests/lib/Files/FilenameValidatorTest.php +++ b/tests/lib/Files/FilenameValidatorTest.php @@ -409,7 +409,7 @@ class FilenameValidatorTest extends TestCase { $this->assertEquals($expected, $validator->sanitizeFilename($filename)); } - public function dataSanitizeFilename(): array { + public static function dataSanitizeFilename(): array { return [ 'valid name' => [ 'a * b.txt', ['.htaccess'], [], [], [], 'a * b.txt'