Skip to content

Commit

Permalink
DEP Use PHPUnit 11
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Sep 6, 2024
1 parent 7fa4a1b commit d06437c
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion tests/php/Conversion/FileConversionManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected function setUp(): void
}
}

public function provideConvert(): array
public static function provideConvert(): array
{
return [
'supported by image converter' => [
Expand Down
6 changes: 3 additions & 3 deletions tests/php/Conversion/InterventionImageFileConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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' => [
Expand Down Expand Up @@ -133,7 +133,7 @@ public function testConvert(array $options): void
}
}

public function provideConvertUnsupported(): array
public static function provideConvertUnsupported(): array
{
return [
'nothing to convert from' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/php/FileNameFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function testFilterWithEmptyString($name)
);
}

public function providerFilterWithEmptyString()
public static function providerFilterWithEmptyString()
{
return [['ö ö ö.jpg'], ['新しいファイル.jpg']];
}
Expand Down
6 changes: 3 additions & 3 deletions tests/php/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function testInvalidImageManipulations()
$this->assertNull($broken->Pad(100, 100));
}

public function appCategoryDataProvider()
public static function appCategoryDataProvider()
{
return [
['image', 'jpg'],
Expand Down Expand Up @@ -846,7 +846,7 @@ public function testGetAllowedExtensions($allowedExtensions, $expected)
/**
* @return array[]
*/
public function allowedExtensionsProvider()
public static function allowedExtensionsProvider()
{
return [
'unkeyed array' => [
Expand Down Expand Up @@ -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];
Expand Down
12 changes: 6 additions & 6 deletions tests/php/FilenameParsing/FileIDHelperResolutionStrategyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected function tearDown(): void
parent::tearDown();
}

public function fileList()
public static function fileList()
{
return [
['root-file'],
Expand All @@ -76,7 +76,7 @@ public function fileList()
];
}

public function fileHelperList()
public static function fileHelperList()
{
$files = $this->fileList();
$list = [];
Expand Down Expand Up @@ -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';

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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 ?? '');
Expand Down Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion tests/php/FilenameParsing/HashFileIDHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);

Expand Down
2 changes: 1 addition & 1 deletion tests/php/Flysystem/FlysystemAssetStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function testGetAsUrlWithGrant($grant)
/**
* @return array[]
*/
public function protectedUrlGrantProvider()
public static function protectedUrlGrantProvider()
{
return [
[true],
Expand Down
10 changes: 5 additions & 5 deletions tests/php/ImageManipulationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public function testAttributesHTML()
);
}

public function lazyLoadProvider()
public static function lazyLoadProvider()
{
return [
'false (bool)' => [false, false],
Expand Down Expand Up @@ -324,7 +324,7 @@ public function testLazyLoad($val, bool $expected)
);
}

public function lazyLoadBadProvider()
public static function lazyLoadBadProvider()
{
return [
'null' => [null],
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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' => [
Expand Down Expand Up @@ -606,7 +606,7 @@ public function testConvert(string $originalFileFixtureClass, string $originalFi
}
}

public function provideConvertChainWithLazyLoad(): array
public static function provideConvertChainWithLazyLoad(): array
{
return [
[true],
Expand Down
2 changes: 1 addition & 1 deletion tests/php/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
2 changes: 1 addition & 1 deletion tests/php/ProtectedFileControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testIsValidFilename($name, $isValid)
);
}

public function getFilenames()
public static function getFilenames()
{
return [
// Valid names
Expand Down
2 changes: 1 addition & 1 deletion tests/php/PublicAssetAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testInitBaseURL()
);
}

public function provideGetPublicUrl(): array
public static function provideGetPublicUrl(): array
{
return [
'filename' => [
Expand Down
4 changes: 2 additions & 2 deletions tests/php/RedirectFileControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function tearDown(): void
parent::tearDown();
}

public function fileList()
public static function fileList()
{
return [
'root file' => ['asdf'],
Expand Down Expand Up @@ -349,7 +349,7 @@ public function testRedirectAfterDeleting($fixtureID)
);
}

public function imageList()
public static function imageList()
{
return [
['', 'test', 'jpg'],
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Shortcodes/ImageShortcodeProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ public function testWhiteIsConfigurable()
);
}

public function gettersAndSettersProvider(): array
public static function gettersAndSettersProvider(): array
{
return [
'image without special characters' => [
Expand Down
8 changes: 4 additions & 4 deletions tests/php/Storage/AssetStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public function testConflictResolution()
*
* @return array
*/
public function dataProviderFileIDs()
public static function dataProviderFileIDs()
{
return [
[
Expand Down Expand Up @@ -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 ?? '');
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d06437c

Please sign in to comment.