Skip to content

Commit ce019af

Browse files
committed
rename $repeat into $repeatTimes
1 parent c6ec4c0 commit ce019af

File tree

7 files changed

+55
-55
lines changed

7 files changed

+55
-55
lines changed

src/Framework/TestBuilder.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
* @param ReflectionClass<TestCase> $theClass
3737
* @param non-empty-string $methodName
3838
* @param list<non-empty-string> $groups
39-
* @param positive-int $repeat
39+
* @param positive-int $repeatTimes
4040
*
4141
* @throws InvalidDataProviderException
4242
*/
43-
public function build(ReflectionClass $theClass, string $methodName, array $groups = [], int $repeat = 1): Test
43+
public function build(ReflectionClass $theClass, string $methodName, array $groups = [], int $repeatTimes = 1): Test
4444
{
4545
$className = $theClass->getName();
4646

@@ -65,7 +65,7 @@ public function build(ReflectionClass $theClass, string $methodName, array $grou
6565
$this->shouldGlobalStateBePreserved($className, $methodName),
6666
$this->backupSettings($className, $methodName),
6767
$groups,
68-
$repeat,
68+
$repeatTimes,
6969
);
7070
}
7171

@@ -87,9 +87,9 @@ public function build(ReflectionClass $theClass, string $methodName, array $grou
8787
* @param array<ProvidedData> $data
8888
* @param array{backupGlobals: ?true, backupGlobalsExcludeList: list<string>, backupStaticProperties: ?true, backupStaticPropertiesExcludeList: array<string,list<string>>} $backupSettings
8989
* @param list<non-empty-string> $groups
90-
* @param positive-int $repeat
90+
* @param positive-int $repeatTimes
9191
*/
92-
private function buildDataProviderTestSuite(string $methodName, string $className, array $data, bool $runTestInSeparateProcess, ?bool $preserveGlobalState, array $backupSettings, array $groups, int $repeat = 1): DataProviderTestSuite
92+
private function buildDataProviderTestSuite(string $methodName, string $className, array $data, bool $runTestInSeparateProcess, ?bool $preserveGlobalState, array $backupSettings, array $groups, int $repeatTimes = 1): DataProviderTestSuite
9393
{
9494
$dataProviderTestSuite = DataProviderTestSuite::empty(
9595
$className . '::' . $methodName,
@@ -112,7 +112,7 @@ private function buildDataProviderTestSuite(string $methodName, string $classNam
112112
$backupSettings,
113113
);
114114

115-
$dataProviderTestSuite->addTest($_test, $groups, $repeat);
115+
$dataProviderTestSuite->addTest($_test, $groups, $repeatTimes);
116116
}
117117

118118
return $dataProviderTestSuite;

src/Framework/TestSuite.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ public static function empty(string $name): static
9696
/**
9797
* @param ReflectionClass<TestCase> $class
9898
* @param list<non-empty-string> $groups
99-
* @param positive-int $repeat
99+
* @param positive-int $repeatTimes
100100
*/
101-
public static function fromClassReflector(ReflectionClass $class, array $groups = [], int $repeat = 1): static
101+
public static function fromClassReflector(ReflectionClass $class, array $groups = [], int $repeatTimes = 1): static
102102
{
103103
$testSuite = new static($class->getName());
104104

@@ -119,7 +119,7 @@ public static function fromClassReflector(ReflectionClass $class, array $groups
119119
continue;
120120
}
121121

122-
$testSuite->addTestMethod($class, $method, $groups, $repeat);
122+
$testSuite->addTestMethod($class, $method, $groups, $repeatTimes);
123123
}
124124

125125
if ($testSuite->isEmpty()) {
@@ -146,9 +146,9 @@ final private function __construct(string $name)
146146
* Adds a test to the suite.
147147
*
148148
* @param list<non-empty-string> $groups
149-
* @param positive-int $repeat
149+
* @param positive-int $repeatTimes
150150
*/
151-
public function addTest(Test $test, array $groups = [], int $repeat = 1): void
151+
public function addTest(Test $test, array $groups = [], int $repeatTimes = 1): void
152152
{
153153
if ($test instanceof self) {
154154
$this->tests[] = $test;
@@ -160,10 +160,10 @@ public function addTest(Test $test, array $groups = [], int $repeat = 1): void
160160

161161
assert($test instanceof TestCase || $test instanceof PhptTestCase);
162162

163-
if ($repeat === 1) {
163+
if ($repeatTimes === 1) {
164164
$this->tests[] = $test;
165165
} else {
166-
$this->tests[] = new RepeatTestSuite($test, $repeat);
166+
$this->tests[] = new RepeatTestSuite($test, $repeatTimes);
167167
}
168168

169169
$this->clearCaches();
@@ -194,11 +194,11 @@ public function addTest(Test $test, array $groups = [], int $repeat = 1): void
194194
*
195195
* @param ReflectionClass<TestCase> $testClass
196196
* @param list<non-empty-string> $groups
197-
* @param positive-int $repeat
197+
* @param positive-int $repeatTimes
198198
*
199199
* @throws Exception
200200
*/
201-
public function addTestSuite(ReflectionClass $testClass, array $groups = [], int $repeat = 1): void
201+
public function addTestSuite(ReflectionClass $testClass, array $groups = [], int $repeatTimes = 1): void
202202
{
203203
if ($testClass->isAbstract()) {
204204
throw new Exception(
@@ -219,7 +219,7 @@ public function addTestSuite(ReflectionClass $testClass, array $groups = [], int
219219
);
220220
}
221221

222-
$this->addTest(self::fromClassReflector($testClass, $groups, $repeat), $groups, $repeat);
222+
$this->addTest(self::fromClassReflector($testClass, $groups, $repeatTimes), $groups, $repeatTimes);
223223
}
224224

225225
/**
@@ -231,20 +231,20 @@ public function addTestSuite(ReflectionClass $testClass, array $groups = [], int
231231
* leaving the current test run untouched.
232232
*
233233
* @param list<non-empty-string> $groups
234-
* @param positive-int $repeat
234+
* @param positive-int $repeatTimes
235235
*
236236
* @throws Exception
237237
*/
238-
public function addTestFile(string $filename, array $groups = [], int $repeat = 1): void
238+
public function addTestFile(string $filename, array $groups = [], int $repeatTimes = 1): void
239239
{
240240
try {
241241
if (str_ends_with($filename, '.phpt') && is_file($filename)) {
242-
$this->addTest(new PhptTestCase($filename), [], $repeat);
242+
$this->addTest(new PhptTestCase($filename), [], $repeatTimes);
243243
} else {
244244
$this->addTestSuite(
245245
(new TestSuiteLoader)->load($filename),
246246
$groups,
247-
$repeat,
247+
$repeatTimes,
248248
);
249249
}
250250
} catch (RunnerException $e) {
@@ -258,14 +258,14 @@ public function addTestFile(string $filename, array $groups = [], int $repeat =
258258
* Wrapper for addTestFile() that adds multiple test files.
259259
*
260260
* @param iterable<string> $fileNames
261-
* @param positive-int $repeat
261+
* @param positive-int $repeatTimes
262262
*
263263
* @throws Exception
264264
*/
265-
public function addTestFiles(iterable $fileNames, int $repeat = 1): void
265+
public function addTestFiles(iterable $fileNames, int $repeatTimes = 1): void
266266
{
267267
foreach ($fileNames as $filename) {
268-
$this->addTestFile((string) $filename, [], $repeat);
268+
$this->addTestFile((string) $filename, [], $repeatTimes);
269269
}
270270
}
271271

@@ -513,17 +513,17 @@ public function isForTestClass(): bool
513513
/**
514514
* @param ReflectionClass<TestCase> $class
515515
* @param list<non-empty-string> $groups
516-
* @param positive-int $repeat
516+
* @param positive-int $repeatTimes
517517
*
518518
* @throws Exception
519519
*/
520-
protected function addTestMethod(ReflectionClass $class, ReflectionMethod $method, array $groups, int $repeat): void
520+
protected function addTestMethod(ReflectionClass $class, ReflectionMethod $method, array $groups, int $repeatTimes): void
521521
{
522522
$className = $class->getName();
523523
$methodName = $method->getName();
524524

525525
try {
526-
$test = (new TestBuilder)->build($class, $methodName, $groups, $repeat);
526+
$test = (new TestBuilder)->build($class, $methodName, $groups, $repeatTimes);
527527
} catch (InvalidDataProviderException $e) {
528528
if ($e->getProviderLabel() === null) {
529529
$message = sprintf(
@@ -573,7 +573,7 @@ protected function addTestMethod(ReflectionClass $class, ReflectionMethod $metho
573573
$groups,
574574
(new Groups)->groups($class->getName(), $methodName),
575575
),
576-
$repeat,
576+
$repeatTimes,
577577
);
578578
}
579579

src/TextUI/Configuration/Cli/Builder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public function fromParameters(array $parameters): Configuration
313313
$printerTestDox = null;
314314
$printerTestDoxSummary = null;
315315
$debug = false;
316-
$repeat = 1;
316+
$repeatTimes = 1;
317317
$withTelemetry = false;
318318
$extensions = [];
319319

@@ -1214,9 +1214,9 @@ public function fromParameters(array $parameters): Configuration
12141214
break;
12151215

12161216
case '--repeat':
1217-
$repeat = (int) $option[1];
1217+
$repeatTimes = (int) $option[1];
12181218

1219-
if ($repeat < 1) {
1219+
if ($repeatTimes < 1) {
12201220
throw new Exception(
12211221
'The value for the --repeat option must be a positive integer',
12221222
);
@@ -1376,7 +1376,7 @@ public function fromParameters(array $parameters): Configuration
13761376
$debug,
13771377
$withTelemetry,
13781378
$extensions,
1379-
$repeat,
1379+
$repeatTimes,
13801380
);
13811381
}
13821382

src/TextUI/Configuration/Cli/Configuration.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
private ?string $logEventsVerboseText;
178178
private bool $debug;
179179
private bool $withTelemetry;
180-
private int $repeat;
180+
private int $repeatTimes;
181181

182182
/**
183183
* @var ?non-empty-list<non-empty-string>
@@ -195,9 +195,9 @@
195195
* @param ?non-empty-list<non-empty-string> $testSuffixes
196196
* @param ?non-empty-list<non-empty-string> $coverageFilter
197197
* @param ?non-empty-list<non-empty-string> $extensions
198-
* @param positive-int $repeat
198+
* @param positive-int $repeatTimes
199199
*/
200-
public function __construct(array $arguments, ?bool $all, ?string $atLeastVersion, ?bool $backupGlobals, ?bool $backupStaticProperties, ?bool $beStrictAboutChangesToGlobalState, ?string $bootstrap, ?string $cacheDirectory, ?bool $cacheResult, bool $checkPhpConfiguration, bool $checkVersion, ?string $colors, null|int|string $columns, ?string $configurationFile, ?string $coverageClover, ?string $coverageCobertura, ?string $coverageCrap4J, ?string $coverageHtml, ?string $coverageOpenClover, ?string $coveragePhp, ?string $coverageText, ?bool $coverageTextShowUncoveredFiles, ?bool $coverageTextShowOnlySummary, ?string $coverageXml, ?bool $pathCoverage, bool $warmCoverageCache, ?int $defaultTimeLimit, ?bool $disableCodeCoverageIgnore, ?bool $disallowTestOutput, ?bool $enforceTimeLimit, ?array $excludeGroups, ?int $executionOrder, ?int $executionOrderDefects, ?bool $failOnAllIssues, ?bool $failOnDeprecation, ?bool $failOnPhpunitDeprecation, ?bool $failOnPhpunitNotice, ?bool $failOnPhpunitWarning, ?bool $failOnEmptyTestSuite, ?bool $failOnIncomplete, ?bool $failOnNotice, ?bool $failOnRisky, ?bool $failOnSkipped, ?bool $failOnWarning, ?bool $doNotFailOnDeprecation, ?bool $doNotFailOnPhpunitDeprecation, ?bool $doNotFailOnPhpunitNotice, ?bool $doNotFailOnPhpunitWarning, ?bool $doNotFailOnEmptyTestSuite, ?bool $doNotFailOnIncomplete, ?bool $doNotFailOnNotice, ?bool $doNotFailOnRisky, ?bool $doNotFailOnSkipped, ?bool $doNotFailOnWarning, ?bool $stopOnDefect, ?bool $stopOnDeprecation, ?string $specificDeprecationToStopOn, ?bool $stopOnError, ?bool $stopOnFailure, ?bool $stopOnIncomplete, ?bool $stopOnNotice, ?bool $stopOnRisky, ?bool $stopOnSkipped, ?bool $stopOnWarning, ?string $filter, ?string $excludeFilter, ?string $generateBaseline, ?string $useBaseline, bool $ignoreBaseline, bool $generateConfiguration, bool $migrateConfiguration, ?array $groups, ?array $testsCovering, ?array $testsUsing, ?array $testsRequiringPhpExtension, bool $help, ?string $includePath, ?array $iniSettings, ?string $junitLogfile, ?string $otrLogfile, ?bool $includeGitInformation, bool $listGroups, bool $listSuites, bool $listTestFiles, bool $listTests, ?string $listTestsXml, ?bool $noCoverage, ?bool $noExtensions, ?bool $noOutput, ?bool $noProgress, ?bool $noResults, ?bool $noLogging, ?bool $processIsolation, ?int $randomOrderSeed, ?bool $reportUselessTests, ?bool $resolveDependencies, ?bool $reverseList, ?bool $stderr, ?bool $strictCoverage, ?string $teamcityLogfile, ?string $testdoxHtmlFile, ?string $testdoxTextFile, ?array $testSuffixes, ?string $testSuite, ?string $excludeTestSuite, bool $useDefaultConfiguration, ?bool $displayDetailsOnAllIssues, ?bool $displayDetailsOnIncompleteTests, ?bool $displayDetailsOnSkippedTests, ?bool $displayDetailsOnTestsThatTriggerDeprecations, ?bool $displayDetailsOnPhpunitDeprecations, ?bool $displayDetailsOnPhpunitNotices, ?bool $displayDetailsOnTestsThatTriggerErrors, ?bool $displayDetailsOnTestsThatTriggerNotices, ?bool $displayDetailsOnTestsThatTriggerWarnings, bool $version, ?array $coverageFilter, ?string $logEventsText, ?string $logEventsVerboseText, ?bool $printerTeamCity, ?bool $testdoxPrinter, ?bool $testdoxPrinterSummary, bool $debug, bool $withTelemetry, ?array $extensions, int $repeat)
200+
public function __construct(array $arguments, ?bool $all, ?string $atLeastVersion, ?bool $backupGlobals, ?bool $backupStaticProperties, ?bool $beStrictAboutChangesToGlobalState, ?string $bootstrap, ?string $cacheDirectory, ?bool $cacheResult, bool $checkPhpConfiguration, bool $checkVersion, ?string $colors, null|int|string $columns, ?string $configurationFile, ?string $coverageClover, ?string $coverageCobertura, ?string $coverageCrap4J, ?string $coverageHtml, ?string $coverageOpenClover, ?string $coveragePhp, ?string $coverageText, ?bool $coverageTextShowUncoveredFiles, ?bool $coverageTextShowOnlySummary, ?string $coverageXml, ?bool $pathCoverage, bool $warmCoverageCache, ?int $defaultTimeLimit, ?bool $disableCodeCoverageIgnore, ?bool $disallowTestOutput, ?bool $enforceTimeLimit, ?array $excludeGroups, ?int $executionOrder, ?int $executionOrderDefects, ?bool $failOnAllIssues, ?bool $failOnDeprecation, ?bool $failOnPhpunitDeprecation, ?bool $failOnPhpunitNotice, ?bool $failOnPhpunitWarning, ?bool $failOnEmptyTestSuite, ?bool $failOnIncomplete, ?bool $failOnNotice, ?bool $failOnRisky, ?bool $failOnSkipped, ?bool $failOnWarning, ?bool $doNotFailOnDeprecation, ?bool $doNotFailOnPhpunitDeprecation, ?bool $doNotFailOnPhpunitNotice, ?bool $doNotFailOnPhpunitWarning, ?bool $doNotFailOnEmptyTestSuite, ?bool $doNotFailOnIncomplete, ?bool $doNotFailOnNotice, ?bool $doNotFailOnRisky, ?bool $doNotFailOnSkipped, ?bool $doNotFailOnWarning, ?bool $stopOnDefect, ?bool $stopOnDeprecation, ?string $specificDeprecationToStopOn, ?bool $stopOnError, ?bool $stopOnFailure, ?bool $stopOnIncomplete, ?bool $stopOnNotice, ?bool $stopOnRisky, ?bool $stopOnSkipped, ?bool $stopOnWarning, ?string $filter, ?string $excludeFilter, ?string $generateBaseline, ?string $useBaseline, bool $ignoreBaseline, bool $generateConfiguration, bool $migrateConfiguration, ?array $groups, ?array $testsCovering, ?array $testsUsing, ?array $testsRequiringPhpExtension, bool $help, ?string $includePath, ?array $iniSettings, ?string $junitLogfile, ?string $otrLogfile, ?bool $includeGitInformation, bool $listGroups, bool $listSuites, bool $listTestFiles, bool $listTests, ?string $listTestsXml, ?bool $noCoverage, ?bool $noExtensions, ?bool $noOutput, ?bool $noProgress, ?bool $noResults, ?bool $noLogging, ?bool $processIsolation, ?int $randomOrderSeed, ?bool $reportUselessTests, ?bool $resolveDependencies, ?bool $reverseList, ?bool $stderr, ?bool $strictCoverage, ?string $teamcityLogfile, ?string $testdoxHtmlFile, ?string $testdoxTextFile, ?array $testSuffixes, ?string $testSuite, ?string $excludeTestSuite, bool $useDefaultConfiguration, ?bool $displayDetailsOnAllIssues, ?bool $displayDetailsOnIncompleteTests, ?bool $displayDetailsOnSkippedTests, ?bool $displayDetailsOnTestsThatTriggerDeprecations, ?bool $displayDetailsOnPhpunitDeprecations, ?bool $displayDetailsOnPhpunitNotices, ?bool $displayDetailsOnTestsThatTriggerErrors, ?bool $displayDetailsOnTestsThatTriggerNotices, ?bool $displayDetailsOnTestsThatTriggerWarnings, bool $version, ?array $coverageFilter, ?string $logEventsText, ?string $logEventsVerboseText, ?bool $printerTeamCity, ?bool $testdoxPrinter, ?bool $testdoxPrinterSummary, bool $debug, bool $withTelemetry, ?array $extensions, int $repeatTimes)
201201
{
202202
$this->arguments = $arguments;
203203
$this->all = $all;
@@ -324,7 +324,7 @@ public function __construct(array $arguments, ?bool $all, ?string $atLeastVersio
324324
$this->debug = $debug;
325325
$this->withTelemetry = $withTelemetry;
326326
$this->extensions = $extensions;
327-
$this->repeat = $repeat;
327+
$this->repeatTimes = $repeatTimes;
328328
}
329329

330330
/**
@@ -2584,9 +2584,9 @@ public function debug(): bool
25842584
/**
25852585
* @return positive-int
25862586
*/
2587-
public function repeat(): int
2587+
public function repeatTimes(): int
25882588
{
2589-
return $this->repeat;
2589+
return $this->repeatTimes;
25902590
}
25912591

25922592
public function withTelemetry(): bool

0 commit comments

Comments
 (0)