-
-
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
Showing
2 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
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,43 @@ | ||
--TEST-- | ||
phpunit --covers PHPUnit\TestFixture\CoversUsesFiltering\Foo | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$traceFile = tempnam(sys_get_temp_dir(), __FILE__); | ||
|
||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--no-output'; | ||
$_SERVER['argv'][] = '--log-events-text'; | ||
$_SERVER['argv'][] = $traceFile; | ||
$_SERVER['argv'][] = '--covers'; | ||
$_SERVER['argv'][] = \PHPUnit\TestFixture\CoversUsesFiltering\Foo::class . ',stdClass'; | ||
$_SERVER['argv'][] = __DIR__ . '/../../_files/covers-uses'; | ||
|
||
require_once __DIR__ . '/../../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
|
||
print file_get_contents($traceFile); | ||
|
||
unlink($traceFile); | ||
--EXPECTF-- | ||
PHPUnit Started (PHPUnit %s using %s) | ||
Test Runner Triggered Warning (Using comma-separated values with --covers is deprecated and will no longer work in PHPUnit 12. You can use --covers multiple times instead.) | ||
Test Runner Configured | ||
Test Suite Loaded (2 tests) | ||
Event Facade Sealed | ||
Test Runner Started | ||
Test Suite Sorted | ||
Test Suite Filtered (1 test) | ||
Test Runner Execution Started (1 test) | ||
Test Suite Started (CLI Arguments, 1 test) | ||
Test Suite Started (PHPUnit\TestFixture\CoversUsesFiltering\CoversTest, 1 test) | ||
Test Preparation Started (PHPUnit\TestFixture\CoversUsesFiltering\CoversTest::testOne) | ||
Test Prepared (PHPUnit\TestFixture\CoversUsesFiltering\CoversTest::testOne) | ||
Test Passed (PHPUnit\TestFixture\CoversUsesFiltering\CoversTest::testOne) | ||
Test Finished (PHPUnit\TestFixture\CoversUsesFiltering\CoversTest::testOne) | ||
Test Suite Finished (PHPUnit\TestFixture\CoversUsesFiltering\CoversTest, 1 test) | ||
Test Suite Finished (CLI Arguments, 1 test) | ||
Test Runner Execution Finished | ||
Test Runner Finished | ||
PHPUnit Finished (Shell Exit Code: 1) |
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,43 @@ | ||
--TEST-- | ||
phpunit --uses PHPUnit\TestFixture\CoversUsesFiltering\Foo | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$traceFile = tempnam(sys_get_temp_dir(), __FILE__); | ||
|
||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--no-output'; | ||
$_SERVER['argv'][] = '--log-events-text'; | ||
$_SERVER['argv'][] = $traceFile; | ||
$_SERVER['argv'][] = '--uses'; | ||
$_SERVER['argv'][] = \PHPUnit\TestFixture\CoversUsesFiltering\Foo::class . ',stdClass'; | ||
$_SERVER['argv'][] = __DIR__ . '/../../_files/covers-uses'; | ||
|
||
require_once __DIR__ . '/../../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
|
||
print file_get_contents($traceFile); | ||
|
||
unlink($traceFile); | ||
--EXPECTF-- | ||
PHPUnit Started (PHPUnit %s using %s) | ||
Test Runner Triggered Warning (Using comma-separated values with --uses is deprecated and will no longer work in PHPUnit 12. You can use --uses multiple times instead.) | ||
Test Runner Configured | ||
Test Suite Loaded (2 tests) | ||
Event Facade Sealed | ||
Test Runner Started | ||
Test Suite Sorted | ||
Test Suite Filtered (1 test) | ||
Test Runner Execution Started (1 test) | ||
Test Suite Started (CLI Arguments, 1 test) | ||
Test Suite Started (PHPUnit\TestFixture\CoversUsesFiltering\UsesTest, 1 test) | ||
Test Preparation Started (PHPUnit\TestFixture\CoversUsesFiltering\UsesTest::testOne) | ||
Test Prepared (PHPUnit\TestFixture\CoversUsesFiltering\UsesTest::testOne) | ||
Test Passed (PHPUnit\TestFixture\CoversUsesFiltering\UsesTest::testOne) | ||
Test Finished (PHPUnit\TestFixture\CoversUsesFiltering\UsesTest::testOne) | ||
Test Suite Finished (PHPUnit\TestFixture\CoversUsesFiltering\UsesTest, 1 test) | ||
Test Suite Finished (CLI Arguments, 1 test) | ||
Test Runner Execution Finished | ||
Test Runner Finished | ||
PHPUnit Finished (Shell Exit Code: 1) |