Skip to content

Commit

Permalink
Move execution ordering tests together
Browse files Browse the repository at this point in the history
  • Loading branch information
epdenouden authored and sebastianbergmann committed Dec 24, 2018
1 parent 0395f41 commit 8a3cea5
Show file tree
Hide file tree
Showing 30 changed files with 160 additions and 121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ $arguments = [
'--cache-result',
'--cache-result-file=' . $target,
'MultiDependencyTest',
realpath(__DIR__ . '/loggers/_files/MultiDependencyTest.php'),
realpath(__DIR__ . '/../execution-order/_files/MultiDependencyTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main(false);

print file_get_contents($target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
phpunit -c ../_files/configuration_stop_on_defect.xml MultiDependencyTest ./tests/_files/MultiDependencyTest.php
--FILE--
<?php
$_SERVER['argv'][1] = '--debug';
$_SERVER['argv'][2] = '-c';
$_SERVER['argv'][3] = __DIR__ . '/../_files/configuration_execution_order_options.xml';
$_SERVER['argv'][4] = 'MultiDependencyTest';
$_SERVER['argv'][5] = __DIR__ . '/loggers/_files/MultiDependencyTest.php';
$arguments = [
'--debug',
'-c',
\realpath(__DIR__ . '/../../_files/configuration_execution_order_options.xml'),
'MultiDependencyTest',
\realpath(__DIR__ . '/_files/MultiDependencyTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $arguments = [
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
phpunit --stop-on-defect StopOnWarningTestSuite ./tests/_files/StopOnWarningTestSuite.php
--FILE--
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--stop-on-defect';
$_SERVER['argv'][3] = 'StopOnWarningTestSuite';
$_SERVER['argv'][4] = __DIR__ . '/../_files/StopOnWarningTestSuite.php';
$arguments = [
'--no-configuration',
'--stop-on-defect',
'StopOnWarningTestSuite',
\realpath(__DIR__ . '/../../_files/StopOnWarningTestSuite.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
phpunit -c ../_files/configuration_stop_on_defect.xml StopOnWarningTestSuite ./tests/_files/StopOnWarningTestSuite.php
--FILE--
<?php
$_SERVER['argv'][1] = '-c';
$_SERVER['argv'][2] = __DIR__ . '/../_files/configuration_stop_on_defect.xml';
$_SERVER['argv'][3] = 'StopOnWarningTestSuite';
$_SERVER['argv'][4] = __DIR__ . '/../_files/StopOnWarningTestSuite.php';
$arguments = [
'-c',
\realpath(__DIR__ . '/../../_files/configuration_stop_on_defect.xml'),
'StopOnWarningTestSuite',
\realpath(__DIR__ . '/../../_files/StopOnWarningTestSuite.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
phpunit --stop-on-error StopOnErrorTestSuite ./tests/_files/StopOnErrorTestSuite.php
--FILE--
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--stop-on-error';
$_SERVER['argv'][3] = 'StopOnErrorTestSuite';
$_SERVER['argv'][4] = __DIR__ . '/../_files/StopOnErrorTestSuite.php';
$arguments = [
'--no-configuration',
'--stop-on-error',
'StopOnErrorTestSuite',
\realpath(__DIR__ . '/../../_files/StopOnErrorTestSuite.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
phpunit -c ../_files/configuration_stop_on_error.xml StopOnErrorTestSuite ./tests/_files/StopOnErrorTestSuite.php
--FILE--
<?php
$_SERVER['argv'][1] = '-c';
$_SERVER['argv'][2] = __DIR__ . '/../_files/configuration_stop_on_error.xml';
$_SERVER['argv'][4] = 'StopOnErrorTestSuite';
$_SERVER['argv'][5] = __DIR__ . '/../_files/StopOnErrorTestSuite.php';
$arguments = [
'-c',
\realpath(__DIR__ . '/../../_files/configuration_stop_on_error.xml'),
'StopOnErrorTestSuite',
\realpath(__DIR__ . '/../../_files/StopOnErrorTestSuite.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
phpunit --stop-on-error StopOnErrorTestSuite ./tests/_files/StopOnErrorTestSuite.php
--FILE--
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--stop-on-incomplete';
$_SERVER['argv'][3] = 'StopOnErrorTestSuite';
$_SERVER['argv'][4] = __DIR__ . '/../_files/StopOnErrorTestSuite.php';
$arguments = [
'--no-configuration',
'--stop-on-incomplete',
'StopOnErrorTestSuite',
\realpath(__DIR__ . '/../../_files/StopOnErrorTestSuite.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
phpunit -c ../_files/configuration_stop_on_incomplete.xml StopOnErrorTestSuite ./tests/_files/StopOnErrorTestSuite.php
--FILE--
<?php
$_SERVER['argv'][1] = '-c';
$_SERVER['argv'][2] = __DIR__ . '/../_files/configuration_stop_on_incomplete.xml';
$_SERVER['argv'][4] = 'StopOnErrorTestSuite';
$_SERVER['argv'][5] = __DIR__ . '/../_files/StopOnErrorTestSuite.php';
$arguments = [
'-c',
\realpath(__DIR__ . '/../../_files/configuration_stop_on_incomplete.xml'),
'StopOnErrorTestSuite',
\realpath(__DIR__ . '/../../_files/StopOnErrorTestSuite.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
phpunit --stop-on-warning StopOnWarningTestSuite ./tests/_files/StopOnWarningTestSuite.php
--FILE--
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--stop-on-warning';
$_SERVER['argv'][3] = 'StopOnWarningTestSuite';
$_SERVER['argv'][4] = __DIR__ . '/../_files/StopOnWarningTestSuite.php';
$arguments = [
'--no-configuration',
'--stop-on-warning',
'StopOnWarningTestSuite',
\realpath(__DIR__ . '/../../_files/StopOnWarningTestSuite.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.
Expand All @@ -22,4 +25,4 @@ There was 1 warning:
No tests found in class "NoTestCases".

WARNINGS!
Tests: 1, Assertions: 0, Warnings: 1.
Tests: 1, Assertions: 0, Warnings: 1.
29 changes: 29 additions & 0 deletions tests/end-to-end/execution-order/stop-on-warning-via-config.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--TEST--
phpunit -c ../../_files/configuration_stop_on_warning.xml --stop-on-warning StopOnWarningTestSuite ./tests/_files/StopOnWarningTestSuite.php
--FILE--
<?php
$arguments = [
'-c',
\realpath(__DIR__ . '/../../_files/configuration_stop_on_warning.xml'),
'--stop-on-warning',
'StopOnWarningTestSuite',
\realpath(__DIR__ . '/../../_files/StopOnWarningTestSuite.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

W

Time: %s, Memory: %s

There was 1 warning:

1) Warning
No tests found in class "NoTestCases".

WARNINGS!
Tests: 1, Assertions: 0, Warnings: 1.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
phpunit --order-by=depends,random --random-order-seed=54321 ../_files/MultiDependencyTest.php
--FILE--
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--debug';
$_SERVER['argv'][3] = '--verbose';
$_SERVER['argv'][4] = '--order-by=depends,random';
$_SERVER['argv'][5] = '--random-order-seed=54321';
$_SERVER['argv'][6] = 'MultiDependencyTest';
$_SERVER['argv'][7] = __DIR__ . '/loggers/_files/MultiDependencyTest.php';
$arguments = [
'--no-configuration',
'--debug',
'--verbose',
'--order-by=depends,random',
'--random-order-seed=54321',
'MultiDependencyTest',
\realpath(__DIR__ . '/../execution-order/_files/MultiDependencyTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
?>
--EXPECTF--
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--TEST--
phpunit --order-by=depends,random ../_files/MultiDependencyTest.php
--FILE--
<?php
$arguments = [
'--no-configuration',
'--verbose',
'--resolve-dependencies', // keep coverage for legacy CLI option
'--order-by=depends,random',
'MultiDependencyTest',
\realpath(__DIR__ . '/../execution-order/_files/MultiDependencyTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
?>
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

Runtime: %s
Random seed: %d

..... 5 / 5 (100%)

Time: %s, Memory: %s

OK (5 tests, 6 assertions)
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
phpunit --verbose --order-by=reverse ../_files/DependencySuccessTest.php
--FILE--
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--debug';
$_SERVER['argv'][3] = '--verbose';
$_SERVER['argv'][4] = '--order-by=depends,reverse';
$_SERVER['argv'][5] = 'MultiDependencyTest';
$_SERVER['argv'][6] = __DIR__ . '/loggers/_files/MultiDependencyTest.php';
$arguments = [
'--no-configuration',
'--debug',
'--verbose',
'--order-by=depends,reverse',
'MultiDependencyTest',
\realpath(__DIR__ . '/../execution-order/_files/MultiDependencyTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../bootstrap.php';
require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
?>
--EXPECTF--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
phpunit --order-by=no-depends,reverse ../_files/MultiDependencyTest.php
--FILE--
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--debug';
$_SERVER['argv'][3] = '--verbose';
$_SERVER['argv'][4] = '--order-by=no-depends,reverse';
$_SERVER['argv'][5] = 'MultiDependencyTest';
$_SERVER['argv'][6] = __DIR__ . '/loggers/_files/MultiDependencyTest.php';

require __DIR__ . '/../bootstrap.php';
$arguments = [
'--no-configuration',
'--debug',
'--verbose',
'--order-by=no-depends,reverse',
'MultiDependencyTest',
\realpath(__DIR__ . '/../execution-order/_files/MultiDependencyTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
?>
--EXPECTF--
Expand Down
26 changes: 0 additions & 26 deletions tests/end-to-end/stop-on-warning-via-config.phpt

This file was deleted.

This file was deleted.

0 comments on commit 8a3cea5

Please sign in to comment.