-
-
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.
Also test --filter option with both configuration and argument
- Loading branch information
1 parent
6420191
commit 72c58ad
Showing
9 changed files
with
153 additions
and
26 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
--TEST-- | ||
phpunit --filter FooTest tests/FooTest.php | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--filter'; | ||
$_SERVER['argv'][] = 'FooTest'; | ||
$_SERVER['argv'][] = __DIR__ . '/../_files/groups/tests/FooTest.php'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
PHPUnit\TextUI\Command::main(); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
Test 'PHPUnit\TestFixture\Groups\FooTest::testOne' started | ||
Test 'PHPUnit\TestFixture\Groups\FooTest::testOne' ended | ||
Test 'PHPUnit\TestFixture\Groups\FooTest::testTwo' started | ||
Test 'PHPUnit\TestFixture\Groups\FooTest::testTwo' ended | ||
Test 'PHPUnit\TestFixture\Groups\FooTest::testThree' started | ||
Test 'PHPUnit\TestFixture\Groups\FooTest::testThree' ended | ||
|
||
|
||
Time: %s, Memory: %s | ||
|
||
OK (3 tests, 3 assertions) |
27 changes: 27 additions & 0 deletions
27
tests/end-to-end/cli/filter-class-match-configuration.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,27 @@ | ||
--TEST-- | ||
phpunit --filter FooTest | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--configuration'; | ||
$_SERVER['argv'][] = __DIR__ . '/../_files/groups'; | ||
$_SERVER['argv'][] = '--filter'; | ||
$_SERVER['argv'][] = 'FooTest'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
PHPUnit\TextUI\Command::main(); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
Test 'PHPUnit\TestFixture\Groups\FooTest::testOne' started | ||
Test 'PHPUnit\TestFixture\Groups\FooTest::testOne' ended | ||
Test 'PHPUnit\TestFixture\Groups\FooTest::testTwo' started | ||
Test 'PHPUnit\TestFixture\Groups\FooTest::testTwo' ended | ||
Test 'PHPUnit\TestFixture\Groups\FooTest::testThree' started | ||
Test 'PHPUnit\TestFixture\Groups\FooTest::testThree' ended | ||
|
||
|
||
Time: %s, Memory: %s | ||
|
||
OK (3 tests, 3 assertions) |
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,17 @@ | ||
--TEST-- | ||
phpunit --filter BarTest tests/FooTest.php | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--filter'; | ||
$_SERVER['argv'][] = 'BarTest'; | ||
$_SERVER['argv'][] = __DIR__ . '/../_files/groups/tests/FooTest.php'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
PHPUnit\TextUI\Command::main(); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
No tests executed! |
17 changes: 17 additions & 0 deletions
17
tests/end-to-end/cli/filter-class-nomatch-configuration.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,17 @@ | ||
--TEST-- | ||
phpunit --filter BarTest | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--configuration'; | ||
$_SERVER['argv'][] = __DIR__ . '/../_files/groups'; | ||
$_SERVER['argv'][] = '--filter'; | ||
$_SERVER['argv'][] = 'BarTest'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
PHPUnit\TextUI\Command::main(); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
No tests executed! |
13 changes: 8 additions & 5 deletions
13
tests/end-to-end/cli/filter-class.phpt → ...end/cli/filter-method-match-argument.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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
--TEST-- | ||
phpunit --filter BankAccountTest ../../_files/BankAccountTest.php | ||
phpunit --filter testOne tests/FooTest.php | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--filter'; | ||
$_SERVER['argv'][] = 'BankAccountTest'; | ||
$_SERVER['argv'][] = __DIR__ . '/../../_files/BankAccountTest.php'; | ||
$_SERVER['argv'][] = 'testOne'; | ||
$_SERVER['argv'][] = __DIR__ . '/../_files/groups/tests/FooTest.php'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
PHPUnit\TextUI\Command::main(); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
... 3 / 3 (100%) | ||
Test 'PHPUnit\TestFixture\Groups\FooTest::testOne' started | ||
Test 'PHPUnit\TestFixture\Groups\FooTest::testOne' ended | ||
|
||
|
||
Time: %s, Memory: %s | ||
|
||
OK (3 tests, 3 assertions) | ||
OK (1 test, 1 assertion) |
23 changes: 23 additions & 0 deletions
23
tests/end-to-end/cli/filter-method-match-configuration.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,23 @@ | ||
--TEST-- | ||
phpunit --filter testOne | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--configuration'; | ||
$_SERVER['argv'][] = __DIR__ . '/../_files/groups'; | ||
$_SERVER['argv'][] = '--filter'; | ||
$_SERVER['argv'][] = 'testOne'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
PHPUnit\TextUI\Command::main(); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
Test 'PHPUnit\TestFixture\Groups\FooTest::testOne' started | ||
Test 'PHPUnit\TestFixture\Groups\FooTest::testOne' ended | ||
|
||
|
||
Time: %s, Memory: %s | ||
|
||
OK (1 test, 1 assertion) |
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,17 @@ | ||
--TEST-- | ||
phpunit --filter testFoo tests/FooTest.php | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--filter'; | ||
$_SERVER['argv'][] = 'testFoo'; | ||
$_SERVER['argv'][] = __DIR__ . '/../_files/groups/tests/FooTest.php'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
PHPUnit\TextUI\Command::main(); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
No tests executed! |
17 changes: 17 additions & 0 deletions
17
tests/end-to-end/cli/filter-method-nomatch-configuration.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,17 @@ | ||
--TEST-- | ||
phpunit --filter testFoo | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--configuration'; | ||
$_SERVER['argv'][] = __DIR__ . '/../_files/groups'; | ||
$_SERVER['argv'][] = '--filter'; | ||
$_SERVER['argv'][] = 'testFoo'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
PHPUnit\TextUI\Command::main(); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
No tests executed! |