Make test data providers static and declare array return types. (#20621)

This commit is contained in:
Wilmer Arambula
2025-10-15 14:01:34 -03:00
committed by GitHub
parent 3f445ad30e
commit da20adc82a
69 changed files with 178 additions and 173 deletions

View File

@@ -167,7 +167,7 @@ class StringHelperTest extends TestCase
/**
* Rules that should work the same for case-sensitive and case-insensitive `startsWith()`.
*/
public function providerStartsWith()
public static function providerStartsWith(): array
{
return [
// positive check
@@ -223,7 +223,7 @@ class StringHelperTest extends TestCase
/**
* Rules that should work the same for case-sensitive and case-insensitive `endsWith()`.
*/
public function providerEndsWith()
public static function providerEndsWith(): array
{
return [
// positive check
@@ -307,7 +307,7 @@ class StringHelperTest extends TestCase
$this->assertEquals($output, $decoded);
}
public function base64UrlEncodedStringsProvider()
public static function base64UrlEncodedStringsProvider(): array
{
return [
['This is an encoded string', 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw=='],
@@ -321,7 +321,7 @@ class StringHelperTest extends TestCase
* Data provider for [[testMatchWildcard()]]
* @return array test data.
*/
public function dataProviderMatchWildcard()
public static function dataProviderMatchWildcard(): array
{
return [
// *
@@ -404,7 +404,7 @@ class StringHelperTest extends TestCase
$this->assertSame($expectedResult, StringHelper::matchWildcard($pattern, $string, $options));
}
public function dataProviderMb_ucfirst()
public static function dataProviderMb_ucfirst(): array
{
return [
['foo', 'Foo'],
@@ -426,7 +426,7 @@ class StringHelperTest extends TestCase
$this->assertSame($expectedResult, StringHelper::mb_ucfirst($string));
}
public function dataProviderMb_ucwords()
public static function dataProviderMb_ucwords(): array
{
return [
['foo', 'Foo'],
@@ -465,7 +465,7 @@ class StringHelperTest extends TestCase
$this->assertSame($expectedResult, StringHelper::dirname($string));
}
public function dataProviderDirname()
public static function dataProviderDirname(): array
{
return [
['\\foo\\bar\\test', '\foo\bar'],
@@ -521,7 +521,7 @@ class StringHelperTest extends TestCase
$this->assertSame($expectedResult, StringHelper::findBetween($string, $start, $end));
}
public function dataProviderFindBetween()
public static function dataProviderFindBetween(): array
{
return [
['hello world hello', ' hello', ' world', null], // end before start