-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f19334f
commit 126dcea
Showing
4 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
tests/end-to-end/execution-order/_files/TestWithDifferentDurations.phpunit.result.cache.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"version":1,"defects":[],"times":{"TestWithDifferentDurations::testOne":1,"TestWithDifferentDurations::testTwo":0.5,"TestWithDifferentDurations::testThree":1.5}} | ||
{"version":1,"defects":[],"times":{"PHPUnit\\TestFixture\\TestWithDifferentDurations::testOne":2.006,"PHPUnit\\TestFixture\\TestWithDifferentDurations::testTwo":0,"PHPUnit\\TestFixture\\TestWithDifferentDurations::testThree":3.001,"PHPUnit\\TestFixture\\ExampleTest::testOne":2.006,"PHPUnit\\TestFixture\\ExampleTest::testTwo":3.001,"PHPUnit\\TestFixture\\ExampleTest::testThree":0}} |
11 changes: 11 additions & 0 deletions
11
tests/end-to-end/execution-order/_files/order-by-duration.phpunit.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../../../../phpunit.xsd" | ||
executionOrder="duration" | ||
> | ||
<testsuites> | ||
<testsuite name="order-by-duration"> | ||
<file>./TestWithDifferentDurations.php</file> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
50 changes: 50 additions & 0 deletions
50
tests/end-to-end/execution-order/order-by-duration-via-cli.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--TEST-- | ||
phpunit --order-by=duration ./tests/end-to-end/execution-order/_files/TestWithDifferentDurations.php | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$tmpResultCache = sys_get_temp_dir() . DIRECTORY_SEPARATOR . sha1(__FILE__); | ||
|
||
\copy(__DIR__ . '/_files/TestWithDifferentDurations.phpunit.result.cache.txt', $tmpResultCache); | ||
|
||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = '--order-by=duration'; | ||
$_SERVER['argv'][] = '--cache-result'; | ||
$_SERVER['argv'][] = '--cache-result-file=' . $tmpResultCache; | ||
$_SERVER['argv'][] = __DIR__ . '/_files/TestWithDifferentDurations.php'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit Started (PHPUnit %s using PHP %s) | ||
Test Runner Configured | ||
Test Suite Loaded (3 tests) | ||
Event Facade Sealed | ||
Test Runner Started | ||
Test Suite Sorted | ||
Test Runner Execution Started (3 tests) | ||
Test Suite Started (PHPUnit\TestFixture\TestWithDifferentDurations, 3 tests) | ||
Test Preparation Started (PHPUnit\TestFixture\TestWithDifferentDurations::testTwo) | ||
Test Prepared (PHPUnit\TestFixture\TestWithDifferentDurations::testTwo) | ||
Assertion Succeeded (Constraint: is true, Value: true) | ||
Test Passed (PHPUnit\TestFixture\TestWithDifferentDurations::testTwo) | ||
Test Finished (PHPUnit\TestFixture\TestWithDifferentDurations::testTwo) | ||
Test Preparation Started (PHPUnit\TestFixture\TestWithDifferentDurations::testOne) | ||
Test Prepared (PHPUnit\TestFixture\TestWithDifferentDurations::testOne) | ||
Assertion Succeeded (Constraint: is true, Value: true) | ||
Test Passed (PHPUnit\TestFixture\TestWithDifferentDurations::testOne) | ||
Test Finished (PHPUnit\TestFixture\TestWithDifferentDurations::testOne) | ||
Test Preparation Started (PHPUnit\TestFixture\TestWithDifferentDurations::testThree) | ||
Test Prepared (PHPUnit\TestFixture\TestWithDifferentDurations::testThree) | ||
Assertion Succeeded (Constraint: is true, Value: true) | ||
Test Passed (PHPUnit\TestFixture\TestWithDifferentDurations::testThree) | ||
Test Finished (PHPUnit\TestFixture\TestWithDifferentDurations::testThree) | ||
Test Suite Finished (PHPUnit\TestFixture\TestWithDifferentDurations, 3 tests) | ||
Test Runner Execution Finished | ||
Test Runner Finished | ||
PHPUnit Finished (Shell Exit Code: 0) | ||
--CLEAN-- | ||
<?php declare(strict_types=1); | ||
unlink(sys_get_temp_dir() . DIRECTORY_SEPARATOR . sha1(__FILE__)); |
54 changes: 54 additions & 0 deletions
54
tests/end-to-end/execution-order/order-by-duration-via-phpunit-xml.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--TEST-- | ||
phpunit --configuration=order-by-duration.phpunit.xml | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$tmpResultCache = sys_get_temp_dir() . DIRECTORY_SEPARATOR . sha1(__FILE__); | ||
|
||
\copy(__DIR__ . '/_files/TestWithDifferentDurations.phpunit.result.cache.txt', $tmpResultCache); | ||
|
||
$phpunitXmlConfig = __DIR__ . '/_files/order-by-duration.phpunit.xml'; | ||
|
||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--configuration=' . $phpunitXmlConfig; | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = '--cache-result'; | ||
$_SERVER['argv'][] = '--cache-result-file=' . $tmpResultCache; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit Started (PHPUnit %s using PHP %s) | ||
Test Runner Configured | ||
Test Suite Loaded (3 tests) | ||
Event Facade Sealed | ||
Test Runner Started | ||
Test Suite Sorted | ||
Test Runner Execution Started (3 tests) | ||
Test Suite Started (%sorder-by-duration.phpunit.xml, 3 tests) | ||
Test Suite Started (order-by-duration, 3 tests) | ||
Test Suite Started (PHPUnit\TestFixture\TestWithDifferentDurations, 3 tests) | ||
Test Preparation Started (PHPUnit\TestFixture\TestWithDifferentDurations::testTwo) | ||
Test Prepared (PHPUnit\TestFixture\TestWithDifferentDurations::testTwo) | ||
Assertion Succeeded (Constraint: is true, Value: true) | ||
Test Passed (PHPUnit\TestFixture\TestWithDifferentDurations::testTwo) | ||
Test Finished (PHPUnit\TestFixture\TestWithDifferentDurations::testTwo) | ||
Test Preparation Started (PHPUnit\TestFixture\TestWithDifferentDurations::testOne) | ||
Test Prepared (PHPUnit\TestFixture\TestWithDifferentDurations::testOne) | ||
Assertion Succeeded (Constraint: is true, Value: true) | ||
Test Passed (PHPUnit\TestFixture\TestWithDifferentDurations::testOne) | ||
Test Finished (PHPUnit\TestFixture\TestWithDifferentDurations::testOne) | ||
Test Preparation Started (PHPUnit\TestFixture\TestWithDifferentDurations::testThree) | ||
Test Prepared (PHPUnit\TestFixture\TestWithDifferentDurations::testThree) | ||
Assertion Succeeded (Constraint: is true, Value: true) | ||
Test Passed (PHPUnit\TestFixture\TestWithDifferentDurations::testThree) | ||
Test Finished (PHPUnit\TestFixture\TestWithDifferentDurations::testThree) | ||
Test Suite Finished (PHPUnit\TestFixture\TestWithDifferentDurations, 3 tests) | ||
Test Suite Finished (order-by-duration, 3 tests) | ||
Test Suite Finished (%sorder-by-duration.phpunit.xml, 3 tests) | ||
Test Runner Execution Finished | ||
Test Runner Finished | ||
PHPUnit Finished (Shell Exit Code: 0) | ||
--CLEAN-- | ||
<?php declare(strict_types=1); | ||
unlink(sys_get_temp_dir() . DIRECTORY_SEPARATOR . sha1(__FILE__)); |