|
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; |
@@ -83,4 +84,54 @@ public function testNoCoverageShouldOnlyAffectXmlConfiguration(): void |
83 | 84 | $this->assertTrue($mergedConfig->hasCoveragePhp()); |
84 | 85 | $this->assertSame($phpCoverage, $mergedConfig->coveragePhp()); |
85 | 86 | } |
| 87 | + |
| 88 | + #[Ticket('https://github.com/sebastianbergmann/phpunit/issues/6340')] |
| 89 | + public function testIssue6340(): void |
| 90 | + { |
| 91 | + $fromFile = (new Loader)->load(TEST_FILES_PATH . 'configuration-issue-6340.xml'); |
| 92 | + |
| 93 | + $this->assertTrue($fromFile->phpunit()->failOnPhpunitDeprecation()); |
| 94 | + $this->assertTrue($fromFile->phpunit()->failOnPhpunitNotice()); |
| 95 | + $this->assertTrue($fromFile->phpunit()->failOnDeprecation()); |
| 96 | + $this->assertTrue($fromFile->phpunit()->failOnNotice()); |
| 97 | + $this->assertTrue($fromFile->phpunit()->failOnWarning()); |
| 98 | + $this->assertTrue($fromFile->phpunit()->failOnIncomplete()); |
| 99 | + $this->assertTrue($fromFile->phpunit()->failOnSkipped()); |
| 100 | + |
| 101 | + $fromCli = (new Builder)->fromParameters([ |
| 102 | + '--do-not-fail-on-phpunit-deprecation', |
| 103 | + '--do-not-fail-on-phpunit-notice', |
| 104 | + '--do-not-fail-on-deprecation', |
| 105 | + '--do-not-fail-on-notice', |
| 106 | + '--do-not-fail-on-warning', |
| 107 | + '--do-not-fail-on-incomplete', |
| 108 | + '--do-not-fail-on-skipped', |
| 109 | + ]); |
| 110 | + |
| 111 | + $this->assertTrue($fromCli->doNotFailOnPhpunitDeprecation()); |
| 112 | + $this->assertTrue($fromCli->doNotFailOnPhpunitNotice()); |
| 113 | + $this->assertTrue($fromCli->doNotFailOnDeprecation()); |
| 114 | + $this->assertTrue($fromCli->doNotFailOnNotice()); |
| 115 | + $this->assertTrue($fromCli->doNotFailOnWarning()); |
| 116 | + $this->assertTrue($fromCli->doNotFailOnIncomplete()); |
| 117 | + $this->assertTrue($fromCli->doNotFailOnSkipped()); |
| 118 | + |
| 119 | + $mergedConfig = (new Merger)->merge($fromCli, $fromFile); |
| 120 | + |
| 121 | + $this->assertTrue($mergedConfig->doNotFailOnPhpunitDeprecation()); |
| 122 | + $this->assertTrue($mergedConfig->doNotFailOnPhpunitNotice()); |
| 123 | + $this->assertTrue($mergedConfig->doNotFailOnDeprecation()); |
| 124 | + $this->assertTrue($mergedConfig->doNotFailOnNotice()); |
| 125 | + $this->assertTrue($mergedConfig->doNotFailOnWarning()); |
| 126 | + $this->assertTrue($mergedConfig->doNotFailOnIncomplete()); |
| 127 | + $this->assertTrue($mergedConfig->doNotFailOnSkipped()); |
| 128 | + |
| 129 | + $this->assertFalse($mergedConfig->displayDetailsOnPhpunitDeprecations()); |
| 130 | + $this->assertFalse($mergedConfig->displayDetailsOnPhpunitNotices()); |
| 131 | + $this->assertFalse($mergedConfig->displayDetailsOnTestsThatTriggerDeprecations()); |
| 132 | + $this->assertFalse($mergedConfig->displayDetailsOnTestsThatTriggerNotices()); |
| 133 | + $this->assertFalse($mergedConfig->displayDetailsOnTestsThatTriggerWarnings()); |
| 134 | + $this->assertFalse($mergedConfig->displayDetailsOnIncompleteTests()); |
| 135 | + $this->assertFalse($mergedConfig->displayDetailsOnSkippedTests()); |
| 136 | + } |
86 | 137 | } |
0 commit comments