mirror of
https://github.com/pestphp/pest.git
synced 2026-12-03 22:45:06 +01:00
Match the exact TeamCity output flag (#2052)
Co-authored-by: haranishi <223786623+haranishi@users.noreply.github.com>
This commit is contained in:
@@ -121,7 +121,7 @@ use Symfony\Component\Console\Output\ConsoleOutput;
|
||||
}
|
||||
}
|
||||
|
||||
if (str_contains($value, '--teamcity')) {
|
||||
if ($value === '--teamcity') {
|
||||
unset($arguments[$key]);
|
||||
$arguments[] = '--no-output';
|
||||
unset($_SERVER['COLLISION_PRINTER']);
|
||||
|
||||
@@ -2503,6 +2503,8 @@
|
||||
WARN Tests\Visual\TeamCity
|
||||
- visual snapshot of team city with ('Failure.php')
|
||||
- visual snapshot of team city with ('SuccessOnly.php')
|
||||
✓ preserves TeamCity text in a test filter with dataset "attached value"
|
||||
✓ preserves TeamCity text in a test filter with dataset "separate value"
|
||||
|
||||
WARN Tests\Visual\Todo
|
||||
- todos
|
||||
@@ -2521,4 +2523,4 @@
|
||||
✓ pass with dataset with ('my-datas-set-value')
|
||||
✓ within describe → pass with dataset with ('my-datas-set-value')
|
||||
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 38 skipped, 1829 passed (4146 assertions)
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 40 todos, 38 skipped, 1831 passed (4150 assertions)
|
||||
@@ -46,3 +46,17 @@ test('visual snapshot of team city', function (string $testFile): void {
|
||||
'Failure.php',
|
||||
'SuccessOnly.php',
|
||||
])->skip(! getenv('REBUILD_SNAPSHOTS') && getenv('EXCLUDE'));
|
||||
|
||||
test('preserves TeamCity text in a test filter', function (array $filterArguments): void {
|
||||
$process = new Process(
|
||||
[PHP_BINARY, 'bin/pest', '--colors=never', 'tests/Fixtures/Suites/SuccessOnly.php', ...$filterArguments],
|
||||
dirname(__DIR__, 2),
|
||||
['PARATEST' => '0', 'PAO_DISABLE' => '1'],
|
||||
);
|
||||
|
||||
expect($process->run())->toBe(0)
|
||||
->and($process->getOutput())->toContain('1 passed (1 assertions)');
|
||||
})->with([
|
||||
'attached value' => [['--filter=can pass with comparison|--teamcity']],
|
||||
'separate value' => [['--filter', 'can pass with comparison|--teamcity']],
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user