|
12 | 12 | use function uniqid; |
13 | 13 | use PHPUnit\Framework\Attributes\CoversClass; |
14 | 14 | use PHPUnit\Framework\Attributes\Medium; |
| 15 | +use PHPUnit\Framework\Attributes\Ticket; |
15 | 16 | use PHPUnit\Framework\TestCase; |
16 | 17 | use PHPUnit\TextUI\CliArguments\Builder; |
17 | 18 | use PHPUnit\TextUI\Configuration\Merger; |
@@ -81,4 +82,49 @@ public function testNoCoverageShouldOnlyAffectXmlConfiguration(): void |
81 | 82 | $this->assertTrue($mergedConfig->hasCoveragePhp()); |
82 | 83 | $this->assertSame($phpCoverage, $mergedConfig->coveragePhp()); |
83 | 84 | } |
| 85 | + |
| 86 | + #[Ticket('https://github.com/sebastianbergmann/phpunit/issues/6340')] |
| 87 | + public function testIssue6340(): void |
| 88 | + { |
| 89 | + $fromFile = (new Loader)->load(TEST_FILES_PATH . 'configuration-issue-6340.xml'); |
| 90 | + |
| 91 | + $this->assertTrue($fromFile->phpunit()->failOnPhpunitDeprecation()); |
| 92 | + $this->assertTrue($fromFile->phpunit()->failOnDeprecation()); |
| 93 | + $this->assertTrue($fromFile->phpunit()->failOnNotice()); |
| 94 | + $this->assertTrue($fromFile->phpunit()->failOnWarning()); |
| 95 | + $this->assertTrue($fromFile->phpunit()->failOnIncomplete()); |
| 96 | + $this->assertTrue($fromFile->phpunit()->failOnSkipped()); |
| 97 | + |
| 98 | + $fromCli = (new Builder)->fromParameters([ |
| 99 | + '--do-not-fail-on-phpunit-deprecation', |
| 100 | + '--do-not-fail-on-deprecation', |
| 101 | + '--do-not-fail-on-notice', |
| 102 | + '--do-not-fail-on-warning', |
| 103 | + '--do-not-fail-on-incomplete', |
| 104 | + '--do-not-fail-on-skipped', |
| 105 | + ]); |
| 106 | + |
| 107 | + $this->assertTrue($fromCli->doNotFailOnPhpunitDeprecation()); |
| 108 | + $this->assertTrue($fromCli->doNotFailOnDeprecation()); |
| 109 | + $this->assertTrue($fromCli->doNotFailOnNotice()); |
| 110 | + $this->assertTrue($fromCli->doNotFailOnWarning()); |
| 111 | + $this->assertTrue($fromCli->doNotFailOnIncomplete()); |
| 112 | + $this->assertTrue($fromCli->doNotFailOnSkipped()); |
| 113 | + |
| 114 | + $mergedConfig = (new Merger)->merge($fromCli, $fromFile); |
| 115 | + |
| 116 | + $this->assertTrue($mergedConfig->doNotFailOnPhpunitDeprecation()); |
| 117 | + $this->assertTrue($mergedConfig->doNotFailOnDeprecation()); |
| 118 | + $this->assertTrue($mergedConfig->doNotFailOnNotice()); |
| 119 | + $this->assertTrue($mergedConfig->doNotFailOnWarning()); |
| 120 | + $this->assertTrue($mergedConfig->doNotFailOnIncomplete()); |
| 121 | + $this->assertTrue($mergedConfig->doNotFailOnSkipped()); |
| 122 | + |
| 123 | + $this->assertFalse($mergedConfig->displayDetailsOnPhpunitDeprecations()); |
| 124 | + $this->assertFalse($mergedConfig->displayDetailsOnTestsThatTriggerDeprecations()); |
| 125 | + $this->assertFalse($mergedConfig->displayDetailsOnTestsThatTriggerNotices()); |
| 126 | + $this->assertFalse($mergedConfig->displayDetailsOnTestsThatTriggerWarnings()); |
| 127 | + $this->assertFalse($mergedConfig->displayDetailsOnIncompleteTests()); |
| 128 | + $this->assertFalse($mergedConfig->displayDetailsOnSkippedTests()); |
| 129 | + } |
84 | 130 | } |
0 commit comments