diff --git a/tests/framework/ChangeLogTest.php b/tests/framework/ChangeLogTest.php index 52bccb4c1b..479b530df1 100644 --- a/tests/framework/ChangeLogTest.php +++ b/tests/framework/ChangeLogTest.php @@ -18,7 +18,7 @@ use yiiunit\TestCase; */ class ChangeLogTest extends TestCase { - public function changeProvider() + public static function changeProvider(): array { $lines = preg_split('~\R~', file_get_contents(__DIR__ . '/../../framework/CHANGELOG.md'), -1, PREG_SPLIT_NO_EMPTY); diff --git a/tests/framework/base/ActionFilterTest.php b/tests/framework/base/ActionFilterTest.php index 2340e30f64..2364746ce3 100644 --- a/tests/framework/base/ActionFilterTest.php +++ b/tests/framework/base/ActionFilterTest.php @@ -90,7 +90,7 @@ class ActionFilterTest extends TestCase $this->assertEquals([1, 3, 2], $controller->result); } - public function actionFilterProvider() + public static function actionFilterProvider(): array { return [ [['class' => 'yii\filters\AccessControl', 'user' => 'yiiunit\framework\base\MockUser']], diff --git a/tests/framework/base/ControllerTest.php b/tests/framework/base/ControllerTest.php index ce97daf76b..0491239ec2 100644 --- a/tests/framework/base/ControllerTest.php +++ b/tests/framework/base/ControllerTest.php @@ -68,7 +68,7 @@ class ControllerTest extends TestCase $this->assertEquals($expectedActionMethod, $actionMethod); } - public function createInlineActionProvider() + public static function createInlineActionProvider(): array { return [ ['\yiiunit\framework\base\TestController', 'non-existent-id', null], @@ -91,7 +91,7 @@ class ControllerTest extends TestCase $this->assertSame($expected, preg_match('/^(?:[a-z0-9_]+-)*[a-z0-9_]+$/', $input)); } - public function actionIdMethodProvider() + public static function actionIdMethodProvider(): array { return [ ['apple-id', 1], diff --git a/tests/framework/base/SecurityTest.php b/tests/framework/base/SecurityTest.php index 365ba6bae5..9f976fd619 100644 --- a/tests/framework/base/SecurityTest.php +++ b/tests/framework/base/SecurityTest.php @@ -182,7 +182,7 @@ TEXT; } } - public function dataProviderEncryptByKeyCompat() + public static function dataProviderEncryptByKeyCompat(): array { // these ciphertexts generated using Yii 2.0.2 which is based on mcrypt. $mcrypt = [ @@ -493,7 +493,7 @@ TEXT; $this->assertEquals($data, $this->security->decryptByKey($encrypted, $key)); } - public function dataProviderEncryptByPasswordCompat() + public static function dataProviderEncryptByPasswordCompat(): array { // these ciphertexts generated using Yii 2.0.2 which is based on mcrypt. $mcrypt = [ @@ -803,7 +803,7 @@ TEXT; $this->assertEquals($data, $this->security->decryptByPassword($encrypted, $password)); } - public function randomKeyInvalidInputs() + public static function randomKeyInvalidInputs(): array { return [ [0], @@ -873,7 +873,7 @@ TEXT; $this->assertEquals(1, preg_match('/[A-Za-z0-9_-]+/', $key)); } - public function dataProviderPbkdf2() + public static function dataProviderPbkdf2(): array { return array_filter([ [ @@ -968,7 +968,7 @@ TEXT; $this->assertEquals($okm, bin2hex($DK)); } - public function dataProviderDeriveKey() + public static function dataProviderDeriveKey(): array { // See Appendix A in https://tools.ietf.org/html/rfc5869 return [ @@ -1061,7 +1061,7 @@ TEXT; $this->assertEquals($okm, bin2hex($dk)); } - public function dataProviderCompareStrings() + public static function dataProviderCompareStrings(): array { return [ ['', ''], @@ -1120,7 +1120,7 @@ TEXT; /** * @return array */ - public function maskProvider() + public static function maskProvider(): array { return [ ['1'], diff --git a/tests/framework/behaviors/AttributeBehaviorTest.php b/tests/framework/behaviors/AttributeBehaviorTest.php index 5266ba8f86..2d9f2a8ad6 100644 --- a/tests/framework/behaviors/AttributeBehaviorTest.php +++ b/tests/framework/behaviors/AttributeBehaviorTest.php @@ -66,7 +66,7 @@ class AttributeBehaviorTest extends TestCase /** * @return array */ - public function preserveNonEmptyValuesDataProvider() + public static function preserveNonEmptyValuesDataProvider(): array { return [ [ diff --git a/tests/framework/behaviors/AttributesBehaviorTest.php b/tests/framework/behaviors/AttributesBehaviorTest.php index 3be2d584ac..c52faeda47 100644 --- a/tests/framework/behaviors/AttributesBehaviorTest.php +++ b/tests/framework/behaviors/AttributesBehaviorTest.php @@ -66,7 +66,7 @@ class AttributesBehaviorTest extends TestCase /** * @return array */ - public function preserveNonEmptyValuesDataProvider() + public static function preserveNonEmptyValuesDataProvider(): array { return [ [ @@ -121,7 +121,7 @@ class AttributesBehaviorTest extends TestCase /** * @return array */ - public function orderProvider() + public static function orderProvider(): array { return [ [ diff --git a/tests/framework/behaviors/TimestampBehaviorTest.php b/tests/framework/behaviors/TimestampBehaviorTest.php index bf1e6da74c..f9c05775a5 100644 --- a/tests/framework/behaviors/TimestampBehaviorTest.php +++ b/tests/framework/behaviors/TimestampBehaviorTest.php @@ -130,7 +130,7 @@ class TimestampBehaviorTest extends TestCase $model->save(false); } - public function expressionProvider() + public static function expressionProvider(): array { return [ [ @@ -142,7 +142,7 @@ class TimestampBehaviorTest extends TestCase [new Expression("strftime('%Y')"), date('Y')], ['2015-10-20', '2015-10-20'], [time(), time()], - [[$this, 'arrayCallable'], '2015-10-20'], + [[null, 'arrayCallable'], '2015-10-20'], ]; } @@ -153,6 +153,10 @@ class TimestampBehaviorTest extends TestCase */ public function testNewRecordExpression($expression, $expected): void { + if (is_array($expression)) { + $expression[0] ??= $this; + } + ActiveRecordTimestamp::$tableName = 'test_auto_timestamp_string'; ActiveRecordTimestamp::$behaviors = [ 'timestamp' => [ diff --git a/tests/framework/caching/CacheTestCase.php b/tests/framework/caching/CacheTestCase.php index 8147daa912..1f8113b6c2 100644 --- a/tests/framework/caching/CacheTestCase.php +++ b/tests/framework/caching/CacheTestCase.php @@ -107,7 +107,7 @@ abstract class CacheTestCase extends TestCase /** * @return array testing multiSet with and without expiry */ - public function multiSetExpiry() + public static function multiSetExpiry(): array { return [[0], [2]]; } diff --git a/tests/framework/console/RequestTest.php b/tests/framework/console/RequestTest.php index af90715a47..dd228d4560 100644 --- a/tests/framework/console/RequestTest.php +++ b/tests/framework/console/RequestTest.php @@ -16,7 +16,7 @@ use yiiunit\TestCase; */ class RequestTest extends TestCase { - public function provider() + public static function provider(): array { return [ [ diff --git a/tests/framework/console/UnknownCommandExceptionTest.php b/tests/framework/console/UnknownCommandExceptionTest.php index 179ba23d87..2318fc6c1a 100644 --- a/tests/framework/console/UnknownCommandExceptionTest.php +++ b/tests/framework/console/UnknownCommandExceptionTest.php @@ -32,7 +32,7 @@ class UnknownCommandExceptionTest extends TestCase ]); } - public function suggestedCommandsProvider() + public static function suggestedCommandsProvider(): array { return [ ['migate', ['migrate']], diff --git a/tests/framework/console/controllers/AssetControllerTest.php b/tests/framework/console/controllers/AssetControllerTest.php index 704873c4c7..77b25bf4ed 100644 --- a/tests/framework/console/controllers/AssetControllerTest.php +++ b/tests/framework/console/controllers/AssetControllerTest.php @@ -466,7 +466,7 @@ EOL; * Data provider for [[testAdjustCssUrl()]]. * @return array test data. */ - public function adjustCssUrlDataProvider() + public static function adjustCssUrlDataProvider(): array { return [ [ @@ -585,7 +585,7 @@ EOL; * Data provider for [[testFindRealPath()]]. * @return array test data */ - public function findRealPathDataProvider() + public static function findRealPathDataProvider(): array { return [ [ diff --git a/tests/framework/console/controllers/MigrateControllerTest.php b/tests/framework/console/controllers/MigrateControllerTest.php index c9e3014785..0536ef8cf4 100644 --- a/tests/framework/console/controllers/MigrateControllerTest.php +++ b/tests/framework/console/controllers/MigrateControllerTest.php @@ -159,7 +159,7 @@ class MigrateControllerTest extends TestCase /** * @return array */ - public function generateMigrationDataProvider() + public static function generateMigrationDataProvider(): array { $params = [ 'create_fields' => [ @@ -359,7 +359,7 @@ class MigrateControllerTest extends TestCase /** * @return array */ - public function generateJunctionMigrationDataProvider() + public static function generateJunctionMigrationDataProvider(): array { return [ ['create_junction_post_and_tag_tables', 'post_tag', 'post', 'tag'], @@ -487,7 +487,7 @@ class MigrateControllerTest extends TestCase $this->assertStringContainsString('No new migrations found. Your system is up-to-date.', $result); } - public function refreshMigrationDataProvider() + public static function refreshMigrationDataProvider(): array { return [ ['default'], diff --git a/tests/framework/console/controllers/PHPMessageControllerTest.php b/tests/framework/console/controllers/PHPMessageControllerTest.php index 9551eecce2..61b874397e 100644 --- a/tests/framework/console/controllers/PHPMessageControllerTest.php +++ b/tests/framework/console/controllers/PHPMessageControllerTest.php @@ -124,7 +124,7 @@ class PHPMessageControllerTest extends BaseMessageControllerTest $this->assertEqualsWithoutLE($expected, $head); } - public function messageFileCategoriesDataProvider() + public static function messageFileCategoriesDataProvider(): array { return [ 'removeUnused:false - unused category should not be removed - normal category' => ['test_delete_category', true, false, true], diff --git a/tests/framework/console/widgets/TableTest.php b/tests/framework/console/widgets/TableTest.php index 431f1afcf7..312cad9da0 100644 --- a/tests/framework/console/widgets/TableTest.php +++ b/tests/framework/console/widgets/TableTest.php @@ -23,7 +23,7 @@ class TableTest extends TestCase $this->mockApplication(); } - public function getTableData() + public static function getTableData(): array { return [ [ @@ -69,7 +69,7 @@ EXPECTED; $this->assertEqualsWithoutLE($expected, $tableContent); } - public function getMultiLineTableData() + public static function getMultiLineTableData(): array { return [ [ @@ -138,7 +138,7 @@ EXPECTED; $this->assertEqualsWithoutLE($expected, $tableContent); } - public function getNumericTableData() + public static function getNumericTableData(): array { return [ [ @@ -658,7 +658,7 @@ EXPECTED; $this->assertTrue(true); } - public function dataMinimumWidth() + public static function dataMinimumWidth(): array { return [ ['X'], diff --git a/tests/framework/data/ActiveDataFilterTest.php b/tests/framework/data/ActiveDataFilterTest.php index 57b96a6ab6..598fcca854 100644 --- a/tests/framework/data/ActiveDataFilterTest.php +++ b/tests/framework/data/ActiveDataFilterTest.php @@ -23,7 +23,7 @@ class ActiveDataFilterTest extends TestCase // Tests : - public function dataProviderBuild() + public static function dataProviderBuild(): array { return [ [ diff --git a/tests/framework/data/DataFilterTest.php b/tests/framework/data/DataFilterTest.php index c36e038c80..cd75719124 100644 --- a/tests/framework/data/DataFilterTest.php +++ b/tests/framework/data/DataFilterTest.php @@ -87,7 +87,7 @@ class DataFilterTest extends TestCase * Data provider for [[testValidate()]]. * @return array test data. */ - public function dataProviderValidate() + public static function dataProviderValidate(): array { return [ [ @@ -295,7 +295,7 @@ class DataFilterTest extends TestCase * Data provider for [[testNormalize()]]. * @return array test data. */ - public function dataProviderNormalize() + public static function dataProviderNormalize(): array { return [ [ diff --git a/tests/framework/data/PaginationTest.php b/tests/framework/data/PaginationTest.php index bc19ce165e..5d64c4af35 100644 --- a/tests/framework/data/PaginationTest.php +++ b/tests/framework/data/PaginationTest.php @@ -33,7 +33,7 @@ class PaginationTest extends TestCase * Data provider for [[testCreateUrl()]]. * @return array test data */ - public function dataProviderCreateUrl() + public static function dataProviderCreateUrl(): array { return [ [ @@ -116,7 +116,7 @@ class PaginationTest extends TestCase $this->assertEquals(999, $pagination->getPage()); } - public function dataProviderPageCount() + public static function dataProviderPageCount(): array { return [ [0, 0, 0], @@ -153,7 +153,7 @@ class PaginationTest extends TestCase $this->assertEquals(0, (new Pagination())->getPage()); } - public function dataProviderSetPage() + public static function dataProviderSetPage(): array { return [ [null, false, 0, null], @@ -188,7 +188,7 @@ class PaginationTest extends TestCase $this->assertEquals($page, $pagination->getPage()); } - public function dataProviderGetPageSize() + public static function dataProviderGetPageSize(): array { return [ [[1, 50], 20], @@ -215,7 +215,7 @@ class PaginationTest extends TestCase $this->assertEquals($pageSize, $pagination->getPageSize()); } - public function dataProviderSetPageSize() + public static function dataProviderSetPageSize(): array { return [ [null, false, false, 20], @@ -250,7 +250,7 @@ class PaginationTest extends TestCase $this->assertEquals($pageSize, $pagination->getPageSize()); } - public function dataProviderGetOffset() + public static function dataProviderGetOffset(): array { return [ [0, 0, 0], @@ -277,7 +277,7 @@ class PaginationTest extends TestCase $this->assertEquals($offset, $pagination->getOffset()); } - public function dataProviderGetLimit() + public static function dataProviderGetLimit(): array { return [ [0, -1], @@ -300,7 +300,7 @@ class PaginationTest extends TestCase $this->assertEquals($limit, $pagination->getLimit()); } - public function dataProviderGetLinks() + public static function dataProviderGetLinks(): array { return [ [0, 0, 0, '/index.php?r=list&page=1&per-page=0', null, null, null, null], diff --git a/tests/framework/data/SortTest.php b/tests/framework/data/SortTest.php index dc70179c42..78698cfac7 100644 --- a/tests/framework/data/SortTest.php +++ b/tests/framework/data/SortTest.php @@ -209,7 +209,7 @@ class SortTest extends TestCase $this->assertEquals('/index.php?r=site%2Findex&sort=age', $sort->createUrl('name')); } - public function providerForLinkWithParams() + public static function providerForLinkWithParams(): array { return [ [true, null, 'Age'], @@ -251,7 +251,7 @@ class SortTest extends TestCase $this->assertEquals($link, $sort->link('age')); } - public function providerForLinkWithParamsAndPassedButEmptySort() + public static function providerForLinkWithParamsAndPassedButEmptySort(): array { return [ [null], @@ -295,7 +295,7 @@ class SortTest extends TestCase ); } - public function providerForLinkWithoutParams() + public static function providerForLinkWithoutParams(): array { return [ [false, null, 'Age'], diff --git a/tests/framework/data/SqlDataProviderTest.php b/tests/framework/data/SqlDataProviderTest.php index e997304e64..a338b724f4 100644 --- a/tests/framework/data/SqlDataProviderTest.php +++ b/tests/framework/data/SqlDataProviderTest.php @@ -48,7 +48,7 @@ class SqlDataProviderTest extends DatabaseTestCase $this->assertEquals(3, $dataProvider->getTotalCount()); } - public function providerForOrderByColumn() + public static function providerForOrderByColumn(): array { return [ 'no marks' => ['name'], diff --git a/tests/framework/di/ContainerTest.php b/tests/framework/di/ContainerTest.php index 09d6fb963e..79f25594fc 100644 --- a/tests/framework/di/ContainerTest.php +++ b/tests/framework/di/ContainerTest.php @@ -592,7 +592,7 @@ class ContainerTest extends TestCase ]); } - public function dataNotInstantiableException() + public static function dataNotInstantiableException(): array { return [ [Bar::class], diff --git a/tests/framework/filters/AccessRuleTest.php b/tests/framework/filters/AccessRuleTest.php index 5004dba606..a152ca17b5 100644 --- a/tests/framework/filters/AccessRuleTest.php +++ b/tests/framework/filters/AccessRuleTest.php @@ -218,7 +218,7 @@ class AccessRuleTest extends TestCase * test user id * expected match result (true, false, null) */ - public function matchRoleProvider() + public static function matchRoleProvider(): array { return [ ['create', true, 'user1', [], true], diff --git a/tests/framework/filters/HostControlTest.php b/tests/framework/filters/HostControlTest.php index 9435f51e73..be34480ff8 100644 --- a/tests/framework/filters/HostControlTest.php +++ b/tests/framework/filters/HostControlTest.php @@ -33,7 +33,7 @@ class HostControlTest extends TestCase /** * @return array test data. */ - public function hostInfoValidationDataProvider() + public static function hostInfoValidationDataProvider(): array { return [ [ diff --git a/tests/framework/filters/PageCacheTest.php b/tests/framework/filters/PageCacheTest.php index e81a28aed2..067d191a91 100644 --- a/tests/framework/filters/PageCacheTest.php +++ b/tests/framework/filters/PageCacheTest.php @@ -39,7 +39,7 @@ class PageCacheTest extends TestCase CacheTestCase::$microtime = null; } - public function cacheTestCaseProvider() + public static function cacheTestCaseProvider(): array { return [ // Basic diff --git a/tests/framework/filters/auth/AuthTest.php b/tests/framework/filters/auth/AuthTest.php index 95e46d8c2e..a8fad5dc20 100644 --- a/tests/framework/filters/auth/AuthTest.php +++ b/tests/framework/filters/auth/AuthTest.php @@ -49,7 +49,7 @@ class AuthTest extends TestCase $this->mockWebApplication($appConfig); } - public function tokenProvider() + public static function tokenProvider(): array { return [ ['token1', 'user1'], @@ -136,7 +136,7 @@ class AuthTest extends TestCase $this->ensureFilterApplies($token, $login, $filter); } - public function authMethodProvider() + public static function authMethodProvider(): array { return [ ['yii\filters\auth\CompositeAuth'], diff --git a/tests/framework/filters/auth/BasicAuthTest.php b/tests/framework/filters/auth/BasicAuthTest.php index efeba37e3e..99c786f956 100644 --- a/tests/framework/filters/auth/BasicAuthTest.php +++ b/tests/framework/filters/auth/BasicAuthTest.php @@ -122,7 +122,7 @@ class BasicAuthTest extends AuthTest $session->destroy(); } - public function authMethodProvider() + public static function authMethodProvider(): array { return [ ['yii\filters\auth\HttpBasicAuth'], diff --git a/tests/framework/filters/auth/CompositeAuthTest.php b/tests/framework/filters/auth/CompositeAuthTest.php index f5524ed48e..b6d0b979b8 100644 --- a/tests/framework/filters/auth/CompositeAuthTest.php +++ b/tests/framework/filters/auth/CompositeAuthTest.php @@ -178,7 +178,7 @@ class CompositeAuthTest extends TestCase $this->assertEquals('success', $controller->run('a')); } - public function compositeAuthDataProvider() + public static function compositeAuthDataProvider(): array { return [ //base usage diff --git a/tests/framework/grid/GridViewTest.php b/tests/framework/grid/GridViewTest.php index e0261a2c87..81ae9dc010 100644 --- a/tests/framework/grid/GridViewTest.php +++ b/tests/framework/grid/GridViewTest.php @@ -44,7 +44,7 @@ class GridViewTest extends TestCase /** * @return array */ - public function emptyDataProvider() + public static function emptyDataProvider(): array { return [ [null, 'No results found.'], diff --git a/tests/framework/grid/SerialColumnTest.php b/tests/framework/grid/SerialColumnTest.php index 149264ccd6..2c5ac9ce05 100644 --- a/tests/framework/grid/SerialColumnTest.php +++ b/tests/framework/grid/SerialColumnTest.php @@ -10,6 +10,7 @@ declare(strict_types=1); namespace yiiunit\framework\grid; +use yiiunit\TestCase; use Yii; use yii\data\ArrayDataProvider; use yii\data\Pagination; @@ -19,7 +20,7 @@ use yii\grid\SerialColumn; /** * @group grid */ -class SerialColumnTest extends \yiiunit\TestCase +class SerialColumnTest extends TestCase { /** * @dataProvider provideRenderDataCellData diff --git a/tests/framework/helpers/ArrayHelperTest.php b/tests/framework/helpers/ArrayHelperTest.php index 7aae8f965d..34cbf0b7c1 100644 --- a/tests/framework/helpers/ArrayHelperTest.php +++ b/tests/framework/helpers/ArrayHelperTest.php @@ -862,7 +862,7 @@ class ArrayHelperTest extends TestCase ArrayHelper::keyExists('a', $array, false); } - public function valueProvider() + public static function valueProvider(): array { return [ ['name', 'test'], @@ -995,7 +995,7 @@ class ArrayHelperTest extends TestCase * Data provider for [[testSetValue()]]. * @return array test data */ - public function dataProviderSetValue() + public static function dataProviderSetValue(): array { return [ [ @@ -1571,7 +1571,7 @@ class ArrayHelperTest extends TestCase * Data provider for [[testRecursiveSort()]]. * @return array test data */ - public function dataProviderRecursiveSort() + public static function dataProviderRecursiveSort(): array { return [ //Normal index array diff --git a/tests/framework/helpers/BaseConsoleTest.php b/tests/framework/helpers/BaseConsoleTest.php index 8ccaee812a..04d1a8ea15 100644 --- a/tests/framework/helpers/BaseConsoleTest.php +++ b/tests/framework/helpers/BaseConsoleTest.php @@ -71,7 +71,7 @@ class BaseConsoleTest extends TestCase $this->assertEquals($ansiExpected, $ansiActual); } - public function ansiColorizedSubstr_withColors_data() + public static function ansiColorizedSubstr_withColors_data(): array { return [ ['%rFoo%gBar%n', 0, 3, '%rFoo%n'], diff --git a/tests/framework/helpers/BaseUrlTest.php b/tests/framework/helpers/BaseUrlTest.php index 28d1ca7358..48d7180340 100644 --- a/tests/framework/helpers/BaseUrlTest.php +++ b/tests/framework/helpers/BaseUrlTest.php @@ -28,7 +28,7 @@ class BaseUrlTest extends TestCase $this->assertEquals($expected, BaseUrl::ensureScheme($url, $scheme)); } - public function ensureSchemeUrlProvider() + public static function ensureSchemeUrlProvider(): array { return [ 'relative url and https scheme will return input url' => [ @@ -69,7 +69,7 @@ class BaseUrlTest extends TestCase ]; } - public function relativeTrueUrlProvider() + public static function relativeTrueUrlProvider(): array { return [ 'url url without protocol' => [ @@ -87,7 +87,7 @@ class BaseUrlTest extends TestCase ]; } - public function relativeFalseUrlProvider() + public static function relativeFalseUrlProvider(): array { return [ 'url with https protocol' => [ diff --git a/tests/framework/helpers/ConsoleTest.php b/tests/framework/helpers/ConsoleTest.php index 51698ab405..a2f3cbdf95 100644 --- a/tests/framework/helpers/ConsoleTest.php +++ b/tests/framework/helpers/ConsoleTest.php @@ -154,7 +154,7 @@ class ConsoleTest extends TestCase } }*/ - public function ansiFormats() + public static function ansiFormats(): array { return [ ['test', 'test'], diff --git a/tests/framework/helpers/FileHelperTest.php b/tests/framework/helpers/FileHelperTest.php index 7df3c08d05..785e22ae25 100644 --- a/tests/framework/helpers/FileHelperTest.php +++ b/tests/framework/helpers/FileHelperTest.php @@ -1266,7 +1266,7 @@ class FileHelperTest extends TestCase FileHelper::changeOwnership($useFile ? $file : null, $ownership, $mode); } - public function changeOwnershipInvalidArgumentsProvider() + public static function changeOwnershipInvalidArgumentsProvider(): array { return [ [false, '123:123', null], @@ -1288,7 +1288,7 @@ class FileHelperTest extends TestCase $this->assertEquals($extensions, FileHelper::getExtensionsByMimeType($mimeType)); } - public function getExtensionsByMimeTypeProvider() + public static function getExtensionsByMimeTypeProvider(): array { return [ [ @@ -1323,7 +1323,7 @@ class FileHelperTest extends TestCase $this->assertEquals($extension, FileHelper::getExtensionByMimeType($mimeType, $preferShort)); } - public function getExtensionByMimeTypeProvider() + public static function getExtensionByMimeTypeProvider(): array { return [ ['application/json', true, 'json'], diff --git a/tests/framework/helpers/FormatConverterTest.php b/tests/framework/helpers/FormatConverterTest.php index 728dbc239d..540af1f04f 100644 --- a/tests/framework/helpers/FormatConverterTest.php +++ b/tests/framework/helpers/FormatConverterTest.php @@ -73,7 +73,7 @@ class FormatConverterTest extends TestCase $this->assertEquals('\\o\\\'\\c\\l\\o\\c\\k', FormatConverter::convertDateIcuToPhp('\'o\'\'clock\'')); } - public function providerForICU2PHPPatterns() + public static function providerForICU2PHPPatterns(): array { return [ 'two single quotes produce one' => ["''", "\\'"], @@ -222,7 +222,7 @@ class FormatConverterTest extends TestCase ); } - public function providerForICU2JUIPatterns() + public static function providerForICU2JUIPatterns(): array { return [ 'era designator like (Anno Domini)' => ['G', ''], @@ -389,7 +389,7 @@ class FormatConverterTest extends TestCase $this->assertEquals($expected, $actual); } - public function providerForPHP2ICUPatterns() + public static function providerForPHP2ICUPatterns(): array { return [ 'single \' should be encoded as \'\', which internally should be encoded as \'\'\'\'' => ["'", "''"], @@ -497,7 +497,7 @@ class FormatConverterTest extends TestCase $this->assertEquals('dd-mm-yy', FormatConverter::convertDatePhpToJui('d-m-Y')); } - public function providerForPHP2JUIPatterns() + public static function providerForPHP2JUIPatterns(): array { return [ 'Day of the month, 2 digits with leading zeros 01 to 31' => ['d', 'dd'], diff --git a/tests/framework/helpers/HtmlTest.php b/tests/framework/helpers/HtmlTest.php index 0b1fe156a5..3d7fe06bef 100644 --- a/tests/framework/helpers/HtmlTest.php +++ b/tests/framework/helpers/HtmlTest.php @@ -205,7 +205,7 @@ class HtmlTest extends TestCase * Data provider for [[testBeginFormSimulateViaPost()]]. * @return array test data */ - public function dataProviderBeginFormSimulateViaPost() + public static function dataProviderBeginFormSimulateViaPost(): array { return [ ['