|
27 | 27 | use PHPUnit\Event\Test\MarkedIncomplete;
|
28 | 28 | use PHPUnit\Event\Test\PreparationStarted;
|
29 | 29 | use PHPUnit\Event\Test\Prepared;
|
| 30 | +use PHPUnit\Event\Test\PrintedUnexpectedOutput; |
30 | 31 | use PHPUnit\Event\Test\Skipped;
|
31 | 32 | use PHPUnit\Event\TestSuite\Started;
|
32 | 33 | use PHPUnit\Event\UnknownSubscriberTypeException;
|
@@ -207,6 +208,18 @@ public function testPrepared(): void
|
207 | 208 | $this->prepared = true;
|
208 | 209 | }
|
209 | 210 |
|
| 211 | + public function testPrintedUnexpectedOutput(PrintedUnexpectedOutput $event): void |
| 212 | + { |
| 213 | + assert($this->currentTestCase !== null); |
| 214 | + |
| 215 | + $systemOut = $this->document->createElement( |
| 216 | + 'system-out', |
| 217 | + Xml::prepareString($event->output()), |
| 218 | + ); |
| 219 | + |
| 220 | + $this->currentTestCase->appendChild($systemOut); |
| 221 | + } |
| 222 | + |
210 | 223 | /**
|
211 | 224 | * @throws InvalidArgumentException
|
212 | 225 | */
|
@@ -301,6 +314,7 @@ private function registerSubscribers(Facade $facade): void
|
301 | 314 | new TestPreparationStartedSubscriber($this),
|
302 | 315 | new TestPreparationFailedSubscriber($this),
|
303 | 316 | new TestPreparedSubscriber($this),
|
| 317 | + new TestPrintedUnexpectedOutputSubscriber($this), |
304 | 318 | new TestFinishedSubscriber($this),
|
305 | 319 | new TestErroredSubscriber($this),
|
306 | 320 | new TestFailedSubscriber($this),
|
|
0 commit comments