From 14daebe17cd94ec7865d6f0881a3b03cb609bd94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 5 May 2019 17:30:37 +0200 Subject: [PATCH] Enhancement: Assert that duration can be specified as order-by option via CLI --- .../TestWithDifferentDurations.php | 28 +++++++++++++++ ...ifferentDurations.phpunit.result.cache.txt | 1 + .../order-by-duration-via-cli.phpt | 34 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 tests/end-to-end/_files/execution-order/TestWithDifferentDurations.php create mode 100644 tests/end-to-end/_files/execution-order/TestWithDifferentDurations.phpunit.result.cache.txt create mode 100644 tests/end-to-end/execution-order/order-by-duration-via-cli.phpt diff --git a/tests/end-to-end/_files/execution-order/TestWithDifferentDurations.php b/tests/end-to-end/_files/execution-order/TestWithDifferentDurations.php new file mode 100644 index 00000000000..102620c1833 --- /dev/null +++ b/tests/end-to-end/_files/execution-order/TestWithDifferentDurations.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +use PHPUnit\Framework\TestCase; + +final class TestWithDifferentDurations extends TestCase +{ + public function testOne(): void + { + $this->assertTrue(true); + } + + public function testTwo(): void + { + $this->assertTrue(true); + } + + public function testThree(): void + { + $this->assertTrue(true); + } +} diff --git a/tests/end-to-end/_files/execution-order/TestWithDifferentDurations.phpunit.result.cache.txt b/tests/end-to-end/_files/execution-order/TestWithDifferentDurations.phpunit.result.cache.txt new file mode 100644 index 00000000000..732de2bb136 --- /dev/null +++ b/tests/end-to-end/_files/execution-order/TestWithDifferentDurations.phpunit.result.cache.txt @@ -0,0 +1 @@ +C:30:"PHPUnit\Runner\TestResultCache":199:{a:2:{s:7:"defects";a:0:{}s:5:"times";a:3:{s:35:"TestWithDifferentDurations::testOne";d:1.000;s:35:"TestWithDifferentDurations::testTwo";d:0.500;s:37:"TestWithDifferentDurations::testThree";d:1.500;}}} diff --git a/tests/end-to-end/execution-order/order-by-duration-via-cli.phpt b/tests/end-to-end/execution-order/order-by-duration-via-cli.phpt new file mode 100644 index 00000000000..88829c830b9 --- /dev/null +++ b/tests/end-to-end/execution-order/order-by-duration-via-cli.phpt @@ -0,0 +1,34 @@ +--TEST-- +phpunit --order-by=duration ./tests/end-to-end/_files/execution-order/TestWithDifferentDurations.php +--FILE-- +