Skip to content

Commit

Permalink
Initial work on #3244
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Nov 19, 2018
1 parent 4de2605 commit 36ed9fe
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
1 change: 0 additions & 1 deletion phpunit.xml
Expand Up @@ -2,7 +2,6 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="phpunit.xsd"
bootstrap="tests/bootstrap.php"
cacheResult="true"
verbose="true">
<testsuites>
<testsuite name="unit">
Expand Down
9 changes: 8 additions & 1 deletion src/TextUI/Command.php
Expand Up @@ -70,6 +70,7 @@ class Command
'prepend=' => null,
'bootstrap=' => null,
'cache-result' => null,
'do-not-cache-result' => null,
'cache-result-file=' => null,
'check-version' => null,
'colors==' => null,
Expand Down Expand Up @@ -305,6 +306,11 @@ protected function handleArguments(array $argv): void

break;

case '--do-not-cache-result':
$this->arguments['cacheResult'] = false;

break;

case '--cache-result-file':
$this->arguments['cacheResultFile'] = $option[1];

Expand Down Expand Up @@ -1160,7 +1166,8 @@ protected function showHelp(): void
--resolve-dependencies Resolve dependencies between tests
--order-by=<order> Run tests in order: default|reverse|random|defects|depends
--random-order-seed=<N> Use a specific random seed <N> for random order
--cache-result Write run result to cache to enable ordering tests defects-first
--cache-result Write test results to cache file
--do-not-cache-result Do not write test results to cache file
Configuration Options:
Expand Down
2 changes: 1 addition & 1 deletion src/TextUI/TestRunner.php
Expand Up @@ -1205,7 +1205,7 @@ protected function handleConfiguration(array &$arguments): void
$arguments['backupStaticAttributes'] = $arguments['backupStaticAttributes'] ?? null;
$arguments['beStrictAboutChangesToGlobalState'] = $arguments['beStrictAboutChangesToGlobalState'] ?? null;
$arguments['beStrictAboutResourceUsageDuringSmallTests'] = $arguments['beStrictAboutResourceUsageDuringSmallTests'] ?? false;
$arguments['cacheResult'] = $arguments['cacheResult'] ?? false;
$arguments['cacheResult'] = $arguments['cacheResult'] ?? true;
$arguments['cacheTokens'] = $arguments['cacheTokens'] ?? false;
$arguments['colors'] = $arguments['colors'] ?? ResultPrinter::COLOR_DEFAULT;
$arguments['columns'] = $arguments['columns'] ?? 80;
Expand Down
4 changes: 2 additions & 2 deletions src/Util/Configuration.php
Expand Up @@ -27,7 +27,7 @@
* <phpunit backupGlobals="false"
* backupStaticAttributes="false"
* bootstrap="/path/to/bootstrap.php"
* cacheResult="false"
* cacheResult="true"
* cacheResultFile=".phpunit.result.cache"
* cacheTokens="false"
* columns="80"
Expand Down Expand Up @@ -930,7 +930,7 @@ public function getPHPUnitConfiguration(): array
if ($root->hasAttribute('cacheResult')) {
$result['cacheResult'] = $this->getBoolean(
(string) $root->getAttribute('cacheResult'),
false
true
);
}

Expand Down
3 changes: 2 additions & 1 deletion tests/end-to-end/help.phpt
Expand Up @@ -90,7 +90,8 @@ Test Execution Options:
--resolve-dependencies Resolve dependencies between tests
--order-by=<order> Run tests in order: default|reverse|random|defects|depends
--random-order-seed=<N> Use a specific random seed <N> for random order
--cache-result Write run result to cache to enable ordering tests defects-first
--cache-result Write test results to cache file
--do-not-cache-result Do not write test results to cache file

Configuration Options:

Expand Down
3 changes: 2 additions & 1 deletion tests/end-to-end/help2.phpt
Expand Up @@ -91,7 +91,8 @@ Test Execution Options:
--resolve-dependencies Resolve dependencies between tests
--order-by=<order> Run tests in order: default|reverse|random|defects|depends
--random-order-seed=<N> Use a specific random seed <N> for random order
--cache-result Write run result to cache to enable ordering tests defects-first
--cache-result Write test results to cache file
--do-not-cache-result Do not write test results to cache file

Configuration Options:

Expand Down

0 comments on commit 36ed9fe

Please sign in to comment.