Skip to content

Commit

Permalink
fixed tests to not use deprecated syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl authored and sebastianbergmann committed Dec 5, 2019
1 parent bbc2ea9 commit 5cf2f25
Show file tree
Hide file tree
Showing 138 changed files with 186 additions and 316 deletions.
5 changes: 2 additions & 3 deletions tests/end-to-end/abstract-test-class.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
--TEST--
phpunit AbstractTest ../../_files/AbstractTest.php
phpunit ../../_files/AbstractTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = 'AbstractTest';
$_SERVER['argv'][3] = __DIR__ . '/../_files/AbstractTest.php';
$_SERVER['argv'][2] = __DIR__ . '/../_files/AbstractTest.php';

require __DIR__ . '/../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
5 changes: 2 additions & 3 deletions tests/end-to-end/assertion.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
phpunit AssertionExampleTest ../../_files/AssertionExampleTest.php
phpunit ../../_files/AssertionExampleTest.php
--SKIPIF--
<?php declare(strict_types=1);
if (PHP_MAJOR_VERSION < 7) {
Expand All @@ -16,8 +16,7 @@ if (ini_get('assert.exception') != 1) {
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = 'AssertionExampleTest';
$_SERVER['argv'][3] = __DIR__ . '/../_files/AssertionExampleTest.php';
$_SERVER['argv'][2] = __DIR__ . '/../_files/AssertionExampleTest.php';

require __DIR__ . '/../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
5 changes: 2 additions & 3 deletions tests/end-to-end/cli/columns-max.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
--TEST--
phpunit --columns=max BankAccountTest ../../_files/BankAccountTest.php
phpunit --columns=max ../../_files/BankAccountTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--columns=max';
$_SERVER['argv'][3] = 'BankAccountTest';
$_SERVER['argv'][4] = __DIR__ . '/../../_files/BankAccountTest.php';
$_SERVER['argv'][3] = __DIR__ . '/../../_files/BankAccountTest.php';

require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
5 changes: 2 additions & 3 deletions tests/end-to-end/cli/columns.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
--TEST--
phpunit --columns=40 BankAccountTest ../../_files/BankAccountTest.php
phpunit --columns=40 ../../_files/BankAccountTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--columns=40';
$_SERVER['argv'][3] = 'BankAccountTest';
$_SERVER['argv'][4] = __DIR__ . '/../../_files/BankAccountTest.php';
$_SERVER['argv'][3] = __DIR__ . '/../../_files/BankAccountTest.php';

require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
3 changes: 1 addition & 2 deletions tests/end-to-end/cli/mycommand.phpt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--TEST--
phpunit BankAccountTest ../../_files/BankAccountTest.php
phpunit ../../_files/BankAccountTest.php
--FILE--
<?php declare(strict_types=1);
$arguments = [
'--no-configuration',
'--my-option=123',
'--my-other-option',
'BankAccountTest',
\realpath(__DIR__ . '/../../_files/BankAccountTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);
Expand Down
2 changes: 1 addition & 1 deletion tests/end-to-end/cli/options-after-arguments.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
phpunit BankAccountTest ../../_files/BankAccountTest.php --colors
phpunit ../../_files/BankAccountTest.php --colors
--FILE--
<?php declare(strict_types=1);
$arguments = [
Expand Down
4 changes: 1 addition & 3 deletions tests/end-to-end/cli/test-file-not-found.phpt
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
--TEST--
Test incorrect testFile is reported
--ARGS--
--no-configuration tests nonExistingFile.php
--no-configuration nonExistingFile.php
--FILE--
<?php declare(strict_types=1);
require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

Cannot open file "nonExistingFile.php".
2 changes: 1 addition & 1 deletion tests/end-to-end/code-coverage-ignore.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
phpunit --colors=never --coverage-text=php://stdout IgnoreCodeCoverageClassTest ../../_files/IgnoreCodeCoverageClassTest.php --whitelist ../../../tests/_files/IgnoreCodeCoverageClass.php
phpunit --colors=never --coverage-text=php://stdout ../../_files/IgnoreCodeCoverageClassTest.php --whitelist ../../../tests/_files/IgnoreCodeCoverageClass.php
--SKIPIF--
<?php declare(strict_types=1);
if (!extension_loaded('xdebug')) {
Expand Down
5 changes: 2 additions & 3 deletions tests/end-to-end/concrete-test-class.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
--TEST--
phpunit ConcreteTest ../../_files/ConcreteTest.php
phpunit ../../_files/ConcreteTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = 'ConcreteTest';
$_SERVER['argv'][3] = __DIR__ . '/../_files/ConcreteTest.php';
$_SERVER['argv'][2] = __DIR__ . '/../_files/ConcreteTest.php';

require __DIR__ . '/../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
4 changes: 2 additions & 2 deletions tests/end-to-end/dataprovider-issue-2833.phpt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
--TEST--
phpunit ../../_files/DataProviderIssue2833
phpunit ../../_files/DataProviderIssue2833/
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = __DIR__ . '/../_files/DataProviderIssue2833';
$_SERVER['argv'][2] = __DIR__ . '/../_files/DataProviderIssue2833/';

require __DIR__ . '/../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
4 changes: 2 additions & 2 deletions tests/end-to-end/dataprovider-issue-2922.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
--TEST--
phpunit --exclude-group=foo ../../_files/DataProviderIssue2922
phpunit --exclude-group=foo ../../_files/DataProviderIssue2922/
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--exclude-group=foo';
$_SERVER['argv'][3] = __DIR__ . '/../_files/DataProviderIssue2922';
$_SERVER['argv'][3] = __DIR__ . '/../_files/DataProviderIssue2922/';

require __DIR__ . '/../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
5 changes: 2 additions & 3 deletions tests/end-to-end/dataprovider-log-xml-isolation.phpt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
--TEST--
phpunit --process-isolation --log-junit php://stdout DataProviderTest ../../_files/DataProviderTest.php
phpunit --process-isolation --log-junit php://stdout ../../_files/DataProviderTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--process-isolation';
$_SERVER['argv'][3] = '--log-junit';
$_SERVER['argv'][4] = 'php://stdout';
$_SERVER['argv'][5] = 'DataProviderTest';
$_SERVER['argv'][6] = __DIR__ . '/../_files/DataProviderTest.php';
$_SERVER['argv'][5] = __DIR__ . '/../_files/DataProviderTest.php';

require __DIR__ . '/../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
5 changes: 2 additions & 3 deletions tests/end-to-end/dataprovider-log-xml.phpt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--TEST--
phpunit --log-junit php://stdout DataProviderTest ../../_files/DataProviderTest.php
phpunit --log-junit php://stdout ../../_files/DataProviderTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--log-junit';
$_SERVER['argv'][3] = 'php://stdout';
$_SERVER['argv'][4] = 'DataProviderTest';
$_SERVER['argv'][5] = __DIR__ . '/../_files/DataProviderTest.php';
$_SERVER['argv'][4] = __DIR__ . '/../_files/DataProviderTest.php';

require __DIR__ . '/../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
5 changes: 2 additions & 3 deletions tests/end-to-end/default-isolation.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
--TEST--
phpunit --process-isolation BankAccountTest ../../_files/BankAccountTest.php
phpunit --process-isolation ../../_files/BankAccountTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--process-isolation';
$_SERVER['argv'][3] = 'BankAccountTest';
$_SERVER['argv'][4] = __DIR__ . '/../_files/BankAccountTest.php';
$_SERVER['argv'][3] = __DIR__ . '/../_files/BankAccountTest.php';

require __DIR__ . '/../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
5 changes: 2 additions & 3 deletions tests/end-to-end/default.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
--TEST--
phpunit BankAccountTest ../../_files/BankAccountTest.php
phpunit ../../_files/BankAccountTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = 'BankAccountTest';
$_SERVER['argv'][3] = __DIR__ . '/../_files/BankAccountTest.php';
$_SERVER['argv'][2] = __DIR__ . '/../_files/BankAccountTest.php';

require __DIR__ . '/../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
2 changes: 1 addition & 1 deletion tests/end-to-end/disable-code-coverage-ignore.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
phpunit --colors=never --coverage-text=php://stdout --disable-coverage-ignore IgnoreCodeCoverageClassTest tests/_files/IgnoreCodeCoverageClassTest.php --whitelist ../../../tests/_files/IgnoreCodeCoverageClass.php
phpunit --colors=never --coverage-text=php://stdout --disable-coverage-ignore tests/_files/IgnoreCodeCoverageClassTest.php --whitelist ../../../tests/_files/IgnoreCodeCoverageClass.php
--SKIPIF--
<?php declare(strict_types=1);
if (!extension_loaded('xdebug')) {
Expand Down
5 changes: 2 additions & 3 deletions tests/end-to-end/empty-testcase.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
--TEST--
phpunit EmptyTestCaseTest ../../_files/EmptyTestCaseTest.php
phpunit ../../_files/EmptyTestCaseTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = 'EmptyTestCaseTest';
$_SERVER['argv'][3] = __DIR__ . '/../_files/EmptyTestCaseTest.php';
$_SERVER['argv'][2] = __DIR__ . '/../_files/EmptyTestCaseTest.php';

require __DIR__ . '/../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
5 changes: 2 additions & 3 deletions tests/end-to-end/exception-stack.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
--TEST--
phpunit ExceptionStackTest ../../_files/ExceptionStackTest.php
phpunit ../../_files/ExceptionStackTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = 'ExceptionStackTest';
$_SERVER['argv'][3] = __DIR__ . '/../_files/ExceptionStackTest.php';
$_SERVER['argv'][2] = __DIR__ . '/../_files/ExceptionStackTest.php';

require __DIR__ . '/../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
5 changes: 2 additions & 3 deletions tests/end-to-end/exclude-group-isolation.phpt
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
--TEST--
phpunit --process-isolation --exclude-group balanceIsInitiallyZero BankAccountTest ../../_files/BankAccountTest.php
phpunit --process-isolation --exclude-group balanceIsInitiallyZero ../../_files/BankAccountTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--process-isolation';
$_SERVER['argv'][3] = '--exclude-group';
$_SERVER['argv'][4] = 'balanceIsInitiallyZero';
$_SERVER['argv'][5] = 'BankAccountTest';
$_SERVER['argv'][6] = __DIR__ . '/../_files/BankAccountTest.php';
$_SERVER['argv'][5] = __DIR__ . '/../_files/BankAccountTest.php';

require __DIR__ . '/../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
5 changes: 2 additions & 3 deletions tests/end-to-end/exclude-group.phpt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--TEST--
phpunit --exclude-group balanceIsInitiallyZero BankAccountTest ../../_files/BankAccountTest.php
phpunit --exclude-group balanceIsInitiallyZero ../../_files/BankAccountTest.php
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--exclude-group';
$_SERVER['argv'][3] = 'balanceIsInitiallyZero';
$_SERVER['argv'][4] = 'BankAccountTest';
$_SERVER['argv'][5] = __DIR__ . '/../_files/BankAccountTest.php';
$_SERVER['argv'][4] = __DIR__ . '/../_files/BankAccountTest.php';

require __DIR__ . '/../bootstrap.php';
PHPUnit\TextUI\Command::main();
Expand Down
3 changes: 1 addition & 2 deletions tests/end-to-end/execution-order/cache-result.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
phpunit --order-by=no-depends,reverse --cache-result --cache-result-file MultiDependencyTest ./tests/_files/MultiDependencyTest.php
phpunit --order-by=no-depends,reverse --cache-result --cache-result-file ./tests/_files/MultiDependencyTest.php
--FILE--
<?php declare(strict_types=1);
$target = tempnam(sys_get_temp_dir(), __FILE__);
Expand All @@ -10,7 +10,6 @@ $arguments = [
'--order-by=reverse',
'--cache-result',
'--cache-result-file=' . $target,
'MultiDependencyTest',
realpath(__DIR__ . '/../execution-order/_files/MultiDependencyTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
phpunit --order-by=defects MultiDependencyTest ./tests/_files/MultiDependencyTest.php
phpunit --order-by=defects ./tests/_files/MultiDependencyTest.php
--FILE--
<?php declare(strict_types=1);
$tmpResultCache = \tempnam(sys_get_temp_dir(), __FILE__);
Expand All @@ -11,7 +11,6 @@ $arguments = [
'--order-by=defects',
'--cache-result',
'--cache-result-file=' . $tmpResultCache,
'MultiDependencyTest',
\realpath(__DIR__ . '/_files/MultiDependencyTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);
Expand Down
3 changes: 1 addition & 2 deletions tests/end-to-end/execution-order/dependencies-clone.phpt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
--TEST--
phpunit --verbose ClonedDependencyTest ../../_files/ClonedDependencyTest.php
phpunit --verbose ../../_files/ClonedDependencyTest.php
--FILE--
<?php declare(strict_types=1);
$arguments = [
'--no-configuration',
'--verbose',
'ClonedDependencyTest',
\realpath(__DIR__ . '/_files/ClonedDependencyTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);
Expand Down
3 changes: 1 addition & 2 deletions tests/end-to-end/execution-order/dependencies-isolation.phpt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--TEST--
phpunit --process-isolation --verbose DependencyTestSuite ../../_files/DependencyTestSuite.php
phpunit --process-isolation --verbose ../../_files/DependencyTestSuite.php
--FILE--
<?php declare(strict_types=1);
$arguments = [
'--no-configuration',
'--process-isolation',
'--verbose',
'DependencyTestSuite',
\realpath(__DIR__ . '/_files/DependencyTestSuite.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
--TEST--
phpunit --process-isolation StackTest _files/StackTest.php
phpunit --process-isolation _files/StackTest.php
--FILE--
<?php declare(strict_types=1);
$arguments = [
'--no-configuration',
'--process-isolation',
'StackTest',
\realpath(__DIR__ . '/_files/StackTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);
Expand Down
3 changes: 1 addition & 2 deletions tests/end-to-end/execution-order/depends-as-parameter.phpt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
--TEST--
phpunit StackTest _files/StackTest.php
phpunit _files/StackTest.php
--FILE--
<?php declare(strict_types=1);
$arguments = [
'--no-configuration',
'StackTest',
\realpath(__DIR__ . '/_files/StackTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
--TEST--
phpunit --process-isolation MultiDependencyTest _files/MultiDependencyTest.php
phpunit --process-isolation _files/MultiDependencyTest.php
--FILE--
<?php declare(strict_types=1);
$arguments = [
'--no-configuration',
'--process-isolation',
'MultiDependencyTest',
\realpath(__DIR__ . '/_files/MultiDependencyTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
--TEST--
phpunit MultiDependencyTest _files/MultiDependencyTest.php
phpunit _files/MultiDependencyTest.php
--FILE--
<?php declare(strict_types=1);
$arguments = [
'--no-configuration',
'MultiDependencyTest',
\realpath(__DIR__ . '/_files/MultiDependencyTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--TEST--
phpunit -c ../_files/configuration_stop_on_defect.xml MultiDependencyTest ./tests/_files/MultiDependencyTest.php
phpunit -c ../_files/configuration_stop_on_defect.xml ./tests/_files/MultiDependencyTest.php
--FILE--
<?php declare(strict_types=1);
$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);
Expand Down
3 changes: 1 addition & 2 deletions tests/end-to-end/execution-order/repeat.phpt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--TEST--
phpunit --repeat 3 BankAccountTest ../../_files/BankAccountTest.php
phpunit --repeat 3 ../../_files/BankAccountTest.php
--FILE--
<?php declare(strict_types=1);
$arguments = [
'--no-configuration',
'--repeat',
'3',
'BankAccountTest',
\realpath(__DIR__ . '/../../_files/BankAccountTest.php'),
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);
Expand Down
Loading

0 comments on commit 5cf2f25

Please sign in to comment.