Skip to content

Commit b3fe701

Browse files
authored
Merge pull request #7656 from paulbalandan/normalize-data-provider-names
Normalize data provider names
2 parents 06e5089 + 0e7e31a commit b3fe701

53 files changed

Lines changed: 266 additions & 255 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.php-cs-fixer.dist.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
]);
4545

4646
$overrides = [
47+
'php_unit_data_provider_name' => [
48+
'prefix' => 'provide',
49+
'suffix' => '',
50+
],
4751
'php_unit_data_provider_return_type' => true,
4852
'no_extra_blank_lines' => [
4953
'tokens' => [

.php-cs-fixer.no-header.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
]);
3131

3232
$overrides = [
33+
'php_unit_data_provider_name' => [
34+
'prefix' => 'provide',
35+
'suffix' => '',
36+
],
3337
'php_unit_data_provider_return_type' => true,
3438
'no_extra_blank_lines' => [
3539
'tokens' => [

.php-cs-fixer.user-guide.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@
5353
'use',
5454
],
5555
],
56+
'php_unit_data_provider_name' => [
57+
'prefix' => 'provide',
58+
'suffix' => '',
59+
],
5660
];
5761

5862
$options = [

tests/system/AutoReview/FrameworkCodeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class FrameworkCodeTest extends TestCase
3939
];
4040

4141
/**
42-
* @dataProvider provideTestClassCases
42+
* @dataProvider provideEachTestClassHasCorrectGroupAnnotation
4343
*
4444
* @phpstan-param class-string $class
4545
*/
@@ -73,7 +73,7 @@ public function testEachTestClassHasCorrectGroupAnnotation(string $class): void
7373
));
7474
}
7575

76-
public function provideTestClassCases(): iterable
76+
public function provideEachTestClassHasCorrectGroupAnnotation(): iterable
7777
{
7878
foreach ($this->getTestClasses() as $class) {
7979
yield $class => [$class];

tests/system/CLI/CLITest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ public function testWindow(): void
450450
}
451451

452452
/**
453-
* @dataProvider tableProvider
453+
* @dataProvider provideTable
454454
*
455455
* @param array $tbody
456456
* @param array $thead
@@ -463,7 +463,7 @@ public function testTable($tbody, $thead, $expected): void
463463
$this->assertSame($this->getStreamFilterBuffer(), $expected);
464464
}
465465

466-
public function tableProvider(): iterable
466+
public function provideTable(): iterable
467467
{
468468
$head = [
469469
'ID',

tests/system/Cache/Handlers/BaseHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
final class BaseHandlerTest extends CIUnitTestCase
2424
{
2525
/**
26-
* @dataProvider invalidTypeProvider
26+
* @dataProvider provideValidateKeyInvalidType
2727
*
2828
* @param mixed $input
2929
*/
@@ -35,7 +35,7 @@ public function testValidateKeyInvalidType($input): void
3535
BaseHandler::validateKey($input);
3636
}
3737

38-
public function invalidTypeProvider(): iterable
38+
public function provideValidateKeyInvalidType(): iterable
3939
{
4040
return [
4141
[true],

tests/system/Cache/Handlers/FileHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public function testIsSupported(): void
273273
}
274274

275275
/**
276-
* @dataProvider modeProvider
276+
* @dataProvider provideSaveMode
277277
*
278278
* permissions given on Windows are fixed to `0666`
279279
*
@@ -296,7 +296,7 @@ public function testSaveMode(int $int, string $string): void
296296
$this->assertSame($string, $mode);
297297
}
298298

299-
public function modeProvider(): iterable
299+
public function provideSaveMode(): iterable
300300
{
301301
return [
302302
[

tests/system/CodeIgniterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ public function testPageCacheSendSecureHeaders(): void
731731
/**
732732
* @param array|bool $cacheQueryStringValue
733733
*
734-
* @dataProvider cacheQueryStringProvider
734+
* @dataProvider providePageCacheWithCacheQueryString
735735
*
736736
* @see https://github.com/codeigniter4/CodeIgniter4/pull/6410
737737
*/
@@ -789,7 +789,7 @@ public function testPageCacheWithCacheQueryString($cacheQueryStringValue, int $e
789789
CITestStreamFilter::removeErrorFilter();
790790
}
791791

792-
public function cacheQueryStringProvider(): iterable
792+
public function providePageCacheWithCacheQueryString(): iterable
793793
{
794794
$testingUrls = [
795795
'test', // URL #1

tests/system/Commands/CommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function testInexistentCommandsButWithManyAlternatives(): void
128128
}
129129

130130
/**
131-
* @dataProvider commandArgsProvider
131+
* @dataProvider provideCommandParsesArgsCorrectly
132132
*/
133133
public function testCommandParsesArgsCorrectly(string $input, array $expected): void
134134
{
@@ -138,7 +138,7 @@ public function testCommandParsesArgsCorrectly(string $input, array $expected):
138138
$this->assertSame($expected, ParamsReveal::$args);
139139
}
140140

141-
public function commandArgsProvider(): iterable
141+
public function provideCommandParsesArgsCorrectly(): iterable
142142
{
143143
return [
144144
[

tests/system/Commands/Utilities/Routes/SampleURIGeneratorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
final class SampleURIGeneratorTest extends CIUnitTestCase
2323
{
2424
/**
25-
* @dataProvider routeKeyProvider
25+
* @dataProvider provideGet
2626
*/
2727
public function testGet(string $routeKey, string $expected): void
2828
{
@@ -33,7 +33,7 @@ public function testGet(string $routeKey, string $expected): void
3333
$this->assertSame($expected, $uri);
3434
}
3535

36-
public function routeKeyProvider(): iterable
36+
public function provideGet(): iterable
3737
{
3838
yield from [
3939
'root' => ['/', '/'],

0 commit comments

Comments
 (0)