-
-
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
4 changed files
with
83 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
26 changes: 26 additions & 0 deletions
26
src/Logging/JUnit/Subscriber/TestPrintedUnexpectedOutputSubscriber.php
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,26 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <sebastian@phpunit.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\Logging\JUnit; | ||
|
||
use PHPUnit\Event\Test\PrintedUnexpectedOutput; | ||
use PHPUnit\Event\Test\PrintedUnexpectedOutputSubscriber; | ||
|
||
/** | ||
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit | ||
* | ||
* @internal This class is not covered by the backward compatibility promise for PHPUnit | ||
*/ | ||
final readonly class TestPrintedUnexpectedOutputSubscriber extends Subscriber implements PrintedUnexpectedOutputSubscriber | ||
{ | ||
public function notify(PrintedUnexpectedOutput $event): void | ||
{ | ||
$this->logger()->testPrintedUnexpectedOutput($event); | ||
} | ||
} |
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-- | ||
https://github.com/sebastianbergmann/phpunit/issues/6098 | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--no-output'; | ||
$_SERVER['argv'][] = '--log-junit'; | ||
$_SERVER['argv'][] = 'php://stdout'; | ||
$_SERVER['argv'][] = __DIR__ . '/6098/Issue6098Test.php'; | ||
|
||
require_once __DIR__ . '/../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<testsuites> | ||
<testsuite name="PHPUnit\TestFixture\Issue6098\Issue6098Test" file="%sIssue6098Test.php" tests="1" assertions="1" errors="0" failures="0" skipped="0" time="%f"> | ||
<testcase name="testOne" file="%sIssue6098Test.php" line="16" class="PHPUnit\TestFixture\Issue6098\Issue6098Test" classname="PHPUnit.TestFixture.Issue6098.Issue6098Test" assertions="1" time="%f"> | ||
<system-out>output</system-out> | ||
</testcase> | ||
</testsuite> | ||
</testsuites> |
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,22 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <sebastian@phpunit.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\TestFixture\Issue6098; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
final class Issue6098Test extends TestCase | ||
{ | ||
public function testOne(): void | ||
{ | ||
print 'output'; | ||
|
||
$this->assertTrue(true); | ||
} | ||
} |