From d06437c14d6bcdadac8cb018e59cfa44ff487ee2 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Fri, 6 Sep 2024 17:17:55 +1200 Subject: [PATCH] DEP Use PHPUnit 11 --- tests/php/Conversion/FileConversionManagerTest.php | 2 +- .../InterventionImageFileConverterTest.php | 6 +++--- tests/php/FileNameFilterTest.php | 2 +- tests/php/FileTest.php | 6 +++--- .../FileIDHelperResolutionStrategyTest.php | 12 ++++++------ tests/php/FilenameParsing/HashFileIDHelperTest.php | 2 +- tests/php/Flysystem/FlysystemAssetStoreTest.php | 2 +- tests/php/ImageManipulationTest.php | 10 +++++----- tests/php/ImageTest.php | 2 +- tests/php/ProtectedFileControllerTest.php | 2 +- tests/php/PublicAssetAdapterTest.php | 2 +- tests/php/RedirectFileControllerTest.php | 4 ++-- tests/php/Shortcodes/ImageShortcodeProviderTest.php | 2 +- tests/php/Storage/AssetStoreTest.php | 8 ++++---- 14 files changed, 31 insertions(+), 31 deletions(-) diff --git a/tests/php/Conversion/FileConversionManagerTest.php b/tests/php/Conversion/FileConversionManagerTest.php index 8ff5d0a5..57be38bc 100644 --- a/tests/php/Conversion/FileConversionManagerTest.php +++ b/tests/php/Conversion/FileConversionManagerTest.php @@ -41,7 +41,7 @@ protected function setUp(): void } } - public function provideConvert(): array + public static function provideConvert(): array { return [ 'supported by image converter' => [ diff --git a/tests/php/Conversion/InterventionImageFileConverterTest.php b/tests/php/Conversion/InterventionImageFileConverterTest.php index 93bc922a..87f7178d 100644 --- a/tests/php/Conversion/InterventionImageFileConverterTest.php +++ b/tests/php/Conversion/InterventionImageFileConverterTest.php @@ -34,7 +34,7 @@ protected function setUp(): void } } - public function provideSupportsConversion(): array + public static function provideSupportsConversion(): array { // We don't need to check every possible file type here. // We're just validating that the logic overall holds true. @@ -99,7 +99,7 @@ public function testSupportsConversion(string $from, string $to, array $options, $this->assertSame($expected, $converter->supportsConversion($from, $to, $options)); } - public function provideConvert(): array + public static function provideConvert(): array { return [ 'no options' => [ @@ -133,7 +133,7 @@ public function testConvert(array $options): void } } - public function provideConvertUnsupported(): array + public static function provideConvertUnsupported(): array { return [ 'nothing to convert from' => [ diff --git a/tests/php/FileNameFilterTest.php b/tests/php/FileNameFilterTest.php index e5f986f6..4deb3e6e 100644 --- a/tests/php/FileNameFilterTest.php +++ b/tests/php/FileNameFilterTest.php @@ -80,7 +80,7 @@ public function testFilterWithEmptyString($name) ); } - public function providerFilterWithEmptyString() + public static function providerFilterWithEmptyString() { return [['ö ö ö.jpg'], ['新しいファイル.jpg']]; } diff --git a/tests/php/FileTest.php b/tests/php/FileTest.php index e696ce88..4547455f 100644 --- a/tests/php/FileTest.php +++ b/tests/php/FileTest.php @@ -185,7 +185,7 @@ public function testInvalidImageManipulations() $this->assertNull($broken->Pad(100, 100)); } - public function appCategoryDataProvider() + public static function appCategoryDataProvider() { return [ ['image', 'jpg'], @@ -846,7 +846,7 @@ public function testGetAllowedExtensions($allowedExtensions, $expected) /** * @return array[] */ - public function allowedExtensionsProvider() + public static function allowedExtensionsProvider() { return [ 'unkeyed array' => [ @@ -1047,7 +1047,7 @@ public function testCanEditFallsBackToCheckingDefaultFilePermissions() * @return Generator * @see testHasRestrictedAccess */ - public function restrictedAccessDataProvider() + public static function restrictedAccessDataProvider() { yield ['restricted-test-r', false]; yield ['restricted-test-r1', false]; diff --git a/tests/php/FilenameParsing/FileIDHelperResolutionStrategyTest.php b/tests/php/FilenameParsing/FileIDHelperResolutionStrategyTest.php index 154a728d..02581a4b 100644 --- a/tests/php/FilenameParsing/FileIDHelperResolutionStrategyTest.php +++ b/tests/php/FilenameParsing/FileIDHelperResolutionStrategyTest.php @@ -65,7 +65,7 @@ protected function tearDown(): void parent::tearDown(); } - public function fileList() + public static function fileList() { return [ ['root-file'], @@ -76,7 +76,7 @@ public function fileList() ]; } - public function fileHelperList() + public static function fileHelperList() { $files = $this->fileList(); $list = []; @@ -301,7 +301,7 @@ public function testResolveMissingFileID($fixtureID) $this->assertNull($redirect, 'Theres no file on our adapter for resolveFileID to find'); } - public function searchTupleStrategyVariation() + public static function searchTupleStrategyVariation() { $expected = 'expected/abcdef7890/file.txt'; @@ -466,7 +466,7 @@ public function testHashlessSearchForTuple() $this->assertEquals($hash, $respPfID->getHash(), 'hash should have been read from main file'); } - public function findVariantsStrategyVariation() + public static function findVariantsStrategyVariation() { $brokenHelper = new BrokenFileIDHelper('nonsense.txt', 'nonsense', '', 'nonsense.txt', false, ''); $mockHelper = new MockFileIDHelper( @@ -599,7 +599,7 @@ public function testParseFileID() $this->assertEmpty($parsedFileID); } - public function listVariantwihtoutFileID() + public static function listVariantwihtoutFileID() { $content = "The quick brown fox jumps over the lazy dog."; $hash = sha1($content ?? ''); @@ -640,7 +640,7 @@ public function testGenerateVariantFileID($mainFilePath, $content, ParsedFileID } } - public function listVariantParsedFiledID() + public static function listVariantParsedFiledID() { $pfid = new ParsedFileID('folder/file.txt', 'abcdef7890'); $ambigious = new ParsedFileID('decade1980/file.txt', 'abcdef7890'); diff --git a/tests/php/FilenameParsing/HashFileIDHelperTest.php b/tests/php/FilenameParsing/HashFileIDHelperTest.php index 18a2935d..6eef40f0 100644 --- a/tests/php/FilenameParsing/HashFileIDHelperTest.php +++ b/tests/php/FilenameParsing/HashFileIDHelperTest.php @@ -177,7 +177,7 @@ public function testHashlessBuildFileID() $this->getHelper()->buildFileID('Filename.txt', ''); } - public function provideRewriteExtension() + public static function provideRewriteExtension() { $jpgToPng = 'ExtRewrite' . Convert::base64url_encode(['jpg', 'png']); diff --git a/tests/php/Flysystem/FlysystemAssetStoreTest.php b/tests/php/Flysystem/FlysystemAssetStoreTest.php index 029eb415..a0fe40d1 100644 --- a/tests/php/Flysystem/FlysystemAssetStoreTest.php +++ b/tests/php/Flysystem/FlysystemAssetStoreTest.php @@ -120,7 +120,7 @@ public function testGetAsUrlWithGrant($grant) /** * @return array[] */ - public function protectedUrlGrantProvider() + public static function protectedUrlGrantProvider() { return [ [true], diff --git a/tests/php/ImageManipulationTest.php b/tests/php/ImageManipulationTest.php index c872f113..38b0ee19 100644 --- a/tests/php/ImageManipulationTest.php +++ b/tests/php/ImageManipulationTest.php @@ -285,7 +285,7 @@ public function testAttributesHTML() ); } - public function lazyLoadProvider() + public static function lazyLoadProvider() { return [ 'false (bool)' => [false, false], @@ -324,7 +324,7 @@ public function testLazyLoad($val, bool $expected) ); } - public function lazyLoadBadProvider() + public static function lazyLoadBadProvider() { return [ 'null' => [null], @@ -390,7 +390,7 @@ public function testLazyLoadIsAccessibleInExtensions() Image::remove_extension(LazyLoadAccessorExtension::class); } - public function renderProvider() + public static function renderProvider() { $alt = 'This is a image Title'; $src = '/assets/ImageTest/folder/test-image.png'; @@ -563,7 +563,7 @@ function (AssetStore $store, string $filename, string $hash, string $variant) { $this->assertSame('Any content will do - csv is just a text file afterall', $manipulated->getString()); } - public function provideConvert(): array + public static function provideConvert(): array { return [ 'supported conversion' => [ @@ -606,7 +606,7 @@ public function testConvert(string $originalFileFixtureClass, string $originalFi } } - public function provideConvertChainWithLazyLoad(): array + public static function provideConvertChainWithLazyLoad(): array { return [ [true], diff --git a/tests/php/ImageTest.php b/tests/php/ImageTest.php index a9f98791..08a0687b 100644 --- a/tests/php/ImageTest.php +++ b/tests/php/ImageTest.php @@ -346,7 +346,7 @@ public function testImageResizeInvalid($width, $height, $error) $image->Pad($width, $height); } - public function providerTestImageResizeInvalid() + public static function providerTestImageResizeInvalid() { return [ ['-1', 100, 'Width must be positive'], diff --git a/tests/php/ProtectedFileControllerTest.php b/tests/php/ProtectedFileControllerTest.php index d8f54415..8d6abcf6 100644 --- a/tests/php/ProtectedFileControllerTest.php +++ b/tests/php/ProtectedFileControllerTest.php @@ -63,7 +63,7 @@ public function testIsValidFilename($name, $isValid) ); } - public function getFilenames() + public static function getFilenames() { return [ // Valid names diff --git a/tests/php/PublicAssetAdapterTest.php b/tests/php/PublicAssetAdapterTest.php index d39cd24b..dd2eb7ec 100644 --- a/tests/php/PublicAssetAdapterTest.php +++ b/tests/php/PublicAssetAdapterTest.php @@ -29,7 +29,7 @@ public function testInitBaseURL() ); } - public function provideGetPublicUrl(): array + public static function provideGetPublicUrl(): array { return [ 'filename' => [ diff --git a/tests/php/RedirectFileControllerTest.php b/tests/php/RedirectFileControllerTest.php index 446bd645..a7ca5469 100644 --- a/tests/php/RedirectFileControllerTest.php +++ b/tests/php/RedirectFileControllerTest.php @@ -60,7 +60,7 @@ protected function tearDown(): void parent::tearDown(); } - public function fileList() + public static function fileList() { return [ 'root file' => ['asdf'], @@ -349,7 +349,7 @@ public function testRedirectAfterDeleting($fixtureID) ); } - public function imageList() + public static function imageList() { return [ ['', 'test', 'jpg'], diff --git a/tests/php/Shortcodes/ImageShortcodeProviderTest.php b/tests/php/Shortcodes/ImageShortcodeProviderTest.php index 35e6102e..24339488 100644 --- a/tests/php/Shortcodes/ImageShortcodeProviderTest.php +++ b/tests/php/Shortcodes/ImageShortcodeProviderTest.php @@ -471,7 +471,7 @@ public function testWhiteIsConfigurable() ); } - public function gettersAndSettersProvider(): array + public static function gettersAndSettersProvider(): array { return [ 'image without special characters' => [ diff --git a/tests/php/Storage/AssetStoreTest.php b/tests/php/Storage/AssetStoreTest.php index fd38c2d0..f37c97a5 100644 --- a/tests/php/Storage/AssetStoreTest.php +++ b/tests/php/Storage/AssetStoreTest.php @@ -235,7 +235,7 @@ public function testConflictResolution() * * @return array */ - public function dataProviderFileIDs() + public static function dataProviderFileIDs() { return [ [ @@ -579,7 +579,7 @@ public function testStoreLocationWritingLogic() $this->assertFileExists(ASSETS_PATH . '/AssetStoreTest/explicitelyPublicStore__variant.txt'); } - public function listOfVariantsToWrite() + public static function listOfVariantsToWrite() { $content = "The quick brown fox jumps over the lazy dog."; $hash = sha1($content ?? ''); @@ -629,7 +629,7 @@ public function testVariantWriteNextToFile( $this->assertTrue($fs->fileExists($expectedVariantPath)); } - public function listOfFilesToNormalise() + public static function listOfFilesToNormalise() { $public = AssetStore::VISIBILITY_PUBLIC; $protected = AssetStore::VISIBILITY_PROTECTED; @@ -728,7 +728,7 @@ public function testNormalise($fsName, array $contents, $filename, $hash, array $protectedStrat->setResolutionFileIDHelpers($originalHelpers); } - public function listOfFileIDsToNormalise() + public static function listOfFileIDsToNormalise() { $public = AssetStore::VISIBILITY_PUBLIC; $protected = AssetStore::VISIBILITY_PROTECTED;