From 3e79f77b55b6bb3faeda7a3b136894ed9f0f16e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 6 May 2019 09:21:10 +0200 Subject: [PATCH] Enhancement: Allow using duration option for execution order --- src/Util/Configuration.php | 4 +++ .../_files/order-by-duration.phpunit.xml | 11 ++++++ .../order-by-duration-via-phpunit-xml.phpt | 35 +++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 tests/end-to-end/execution-order/_files/order-by-duration.phpunit.xml create mode 100644 tests/end-to-end/execution-order/order-by-duration-via-phpunit-xml.phpt diff --git a/src/Util/Configuration.php b/src/Util/Configuration.php index b79916c843d..6b4db4faec9 100644 --- a/src/Util/Configuration.php +++ b/src/Util/Configuration.php @@ -853,6 +853,10 @@ public function getPHPUnitConfiguration(): array case 'no-depends': $result['resolveDependencies'] = false; + break; + case 'duration': + $result['executionOrder'] = TestSuiteSorter::ORDER_DURATION; + break; } } diff --git a/tests/end-to-end/execution-order/_files/order-by-duration.phpunit.xml b/tests/end-to-end/execution-order/_files/order-by-duration.phpunit.xml new file mode 100644 index 00000000000..6762ce594d8 --- /dev/null +++ b/tests/end-to-end/execution-order/_files/order-by-duration.phpunit.xml @@ -0,0 +1,11 @@ + + + + . + + + diff --git a/tests/end-to-end/execution-order/order-by-duration-via-phpunit-xml.phpt b/tests/end-to-end/execution-order/order-by-duration-via-phpunit-xml.phpt new file mode 100644 index 00000000000..604e35d9919 --- /dev/null +++ b/tests/end-to-end/execution-order/order-by-duration-via-phpunit-xml.phpt @@ -0,0 +1,35 @@ +--TEST-- +phpunit --order-by=duration ./tests/end-to-end/execution-order/_files/TestWithDifferentDurations.php +--FILE-- +