|
| 1 | +--TEST-- |
| 2 | +#[Repeat] with JUnit XML logging records repetitions skipped after the failure threshold is reached |
| 3 | +--FILE-- |
| 4 | +<?php declare(strict_types=1); |
| 5 | +$junitFile = tempnam(sys_get_temp_dir(), 'phpunit_repeat_junit_'); |
| 6 | + |
| 7 | +$_SERVER['argv'][] = '--no-configuration'; |
| 8 | +$_SERVER['argv'][] = '--do-not-cache-result'; |
| 9 | +$_SERVER['argv'][] = '--no-output'; |
| 10 | +$_SERVER['argv'][] = '--log-junit'; |
| 11 | +$_SERVER['argv'][] = $junitFile; |
| 12 | +$_SERVER['argv'][] = __DIR__ . '/_files/FailureThresholdReachedTest.php'; |
| 13 | + |
| 14 | +require __DIR__ . '/../../bootstrap.php'; |
| 15 | + |
| 16 | +(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); |
| 17 | + |
| 18 | +print file_get_contents($junitFile); |
| 19 | + |
| 20 | +unlink($junitFile); |
| 21 | +--EXPECTF-- |
| 22 | +<?xml version="1.0" encoding="UTF-8"?> |
| 23 | +<testsuites> |
| 24 | + <testsuite name="PHPUnit\TestFixture\Repeat\FailureThresholdReachedTest" file="%sFailureThresholdReachedTest.php" tests="5" assertions="2" errors="0" failures="2" skipped="3" time="%f"> |
| 25 | + <testsuite name="PHPUnit\TestFixture\Repeat\FailureThresholdReachedTest::testOne" tests="5" assertions="2" errors="0" failures="2" skipped="3" time="%f"> |
| 26 | + <testcase name="testOne (repetition 1 of 5)" file="%sFailureThresholdReachedTest.php" line="21" class="PHPUnit\TestFixture\Repeat\FailureThresholdReachedTest" classname="PHPUnit.TestFixture.Repeat.FailureThresholdReachedTest" assertions="1" time="%f"> |
| 27 | + <failure type="PHPUnit\Framework\AssertionFailedError">PHPUnit\TestFixture\Repeat\FailureThresholdReachedTest::testOne (repetition 1 of 5)%A |
| 28 | +Failure on repetition 1 |
| 29 | +%A |
| 30 | +%sFailureThresholdReachedTest.php:26</failure> |
| 31 | + </testcase> |
| 32 | + <testcase name="testOne (repetition 2 of 5)" file="%sFailureThresholdReachedTest.php" line="21" class="PHPUnit\TestFixture\Repeat\FailureThresholdReachedTest" classname="PHPUnit.TestFixture.Repeat.FailureThresholdReachedTest" assertions="1" time="%f"> |
| 33 | + <failure type="PHPUnit\Framework\AssertionFailedError">PHPUnit\TestFixture\Repeat\FailureThresholdReachedTest::testOne (repetition 2 of 5)%A |
| 34 | +Failure on repetition 2 |
| 35 | +%A |
| 36 | +%sFailureThresholdReachedTest.php:26</failure> |
| 37 | + </testcase> |
| 38 | + <testcase name="testOne (repetition 3 of 5)" file="%sFailureThresholdReachedTest.php" line="21" class="PHPUnit\TestFixture\Repeat\FailureThresholdReachedTest" classname="PHPUnit.TestFixture.Repeat.FailureThresholdReachedTest" assertions="0" time="%f"> |
| 39 | + <skipped/> |
| 40 | + </testcase> |
| 41 | + <testcase name="testOne (repetition 4 of 5)" file="%sFailureThresholdReachedTest.php" line="21" class="PHPUnit\TestFixture\Repeat\FailureThresholdReachedTest" classname="PHPUnit.TestFixture.Repeat.FailureThresholdReachedTest" assertions="0" time="%f"> |
| 42 | + <skipped/> |
| 43 | + </testcase> |
| 44 | + <testcase name="testOne (repetition 5 of 5)" file="%sFailureThresholdReachedTest.php" line="21" class="PHPUnit\TestFixture\Repeat\FailureThresholdReachedTest" classname="PHPUnit.TestFixture.Repeat.FailureThresholdReachedTest" assertions="0" time="%f"> |
| 45 | + <skipped/> |
| 46 | + </testcase> |
| 47 | + </testsuite> |
| 48 | + </testsuite> |
| 49 | +</testsuites> |
0 commit comments