diff --git a/src/TextUI/Command.php b/src/TextUI/Command.php index 9b66bc19272..9cc9a480e32 100644 --- a/src/TextUI/Command.php +++ b/src/TextUI/Command.php @@ -1158,7 +1158,7 @@ protected function showHelp(): void --printer TestListener implementation to use --resolve-dependencies Resolve dependencies between tests - --order-by= Run tests in order: default|reverse|random|defects|depends + --order-by= Run tests in order: default|reverse|random|defects|depends|duration --random-order-seed= Use a specific random seed for random order --cache-result Write run result to cache to enable ordering tests defects-first @@ -1366,6 +1366,11 @@ private function handleOrderByOption(string $value): void break; + case 'duration': + $this->arguments['executionOrder'] = TestSuiteSorter::ORDER_DURATION; + + break; + default: $this->exitWithErrorMessage("unrecognized --order-by option: $order"); } diff --git a/tests/end-to-end/help.phpt b/tests/end-to-end/help.phpt index fb069f0e4d2..89220edf0e5 100644 --- a/tests/end-to-end/help.phpt +++ b/tests/end-to-end/help.phpt @@ -88,7 +88,7 @@ Test Execution Options: --printer TestListener implementation to use --resolve-dependencies Resolve dependencies between tests - --order-by= Run tests in order: default|reverse|random|defects|depends + --order-by= Run tests in order: default|reverse|random|defects|depends|duration --random-order-seed= Use a specific random seed for random order --cache-result Write run result to cache to enable ordering tests defects-first diff --git a/tests/end-to-end/help2.phpt b/tests/end-to-end/help2.phpt index b0c6ecb9e2f..bb6c002fa7c 100644 --- a/tests/end-to-end/help2.phpt +++ b/tests/end-to-end/help2.phpt @@ -89,7 +89,7 @@ Test Execution Options: --printer TestListener implementation to use --resolve-dependencies Resolve dependencies between tests - --order-by= Run tests in order: default|reverse|random|defects|depends + --order-by= Run tests in order: default|reverse|random|defects|depends|duration --random-order-seed= Use a specific random seed for random order --cache-result Write run result to cache to enable ordering tests defects-first