|
21 | 21 | #[TestDox('CLI Options Parser')] |
22 | 22 | final class BuilderTest extends TestCase |
23 | 23 | { |
| 24 | + #[TestDox('argument')] |
| 25 | + public function testArguments(): void |
| 26 | + { |
| 27 | + $configuration = (new Builder)->fromParameters(['command', 'argument']); |
| 28 | + |
| 29 | + $this->assertSame(['argument'], $configuration->arguments()); |
| 30 | + } |
| 31 | + |
24 | 32 | #[TestDox('--colors')] |
25 | 33 | public function testColorsImplicitAuto(): void |
26 | 34 | { |
@@ -1422,6 +1430,10 @@ public function testStopOnDeprecation(): void |
1422 | 1430 |
|
1423 | 1431 | $this->assertTrue($configuration->hasStopOnDeprecation()); |
1424 | 1432 | $this->assertTrue($configuration->stopOnDeprecation()); |
| 1433 | + |
| 1434 | + $this->expectException(Exception::class); |
| 1435 | + |
| 1436 | + $configuration->specificDeprecationToStopOn(); |
1425 | 1437 | } |
1426 | 1438 |
|
1427 | 1439 | #[TestDox('--stop-on-deprecation=message')] |
@@ -1626,6 +1638,26 @@ public function testTestDoxMayNotBeConfigured(): void |
1626 | 1638 | $configuration->testdoxPrinter(); |
1627 | 1639 | } |
1628 | 1640 |
|
| 1641 | + #[TestDox('--testdox-summary')] |
| 1642 | + public function testTestDoxPrinterSummary(): void |
| 1643 | + { |
| 1644 | + $configuration = (new Builder)->fromParameters(['--testdox-summary']); |
| 1645 | + |
| 1646 | + $this->assertTrue($configuration->hasTestDoxPrinterSummary()); |
| 1647 | + $this->assertTrue($configuration->testdoxPrinterSummary()); |
| 1648 | + } |
| 1649 | + |
| 1650 | + public function testTestDoxPrinterSummaryMayNotBeConfigured(): void |
| 1651 | + { |
| 1652 | + $configuration = (new Builder)->fromParameters([]); |
| 1653 | + |
| 1654 | + $this->assertFalse($configuration->hasTestDoxPrinterSummary()); |
| 1655 | + |
| 1656 | + $this->expectException(Exception::class); |
| 1657 | + |
| 1658 | + $configuration->testdoxPrinterSummary(); |
| 1659 | + } |
| 1660 | + |
1629 | 1661 | #[TestDox('--testdox-html file')] |
1630 | 1662 | public function testTestDoxHtml(): void |
1631 | 1663 | { |
@@ -2263,6 +2295,26 @@ public function testDebug(): void |
2263 | 2295 | $this->assertTrue($configuration->debug()); |
2264 | 2296 | } |
2265 | 2297 |
|
| 2298 | + #[TestDox('--extension')] |
| 2299 | + public function testExtension(): void |
| 2300 | + { |
| 2301 | + $configuration = (new Builder)->fromParameters(['--extension', 'ExtensionClass']); |
| 2302 | + |
| 2303 | + $this->assertTrue($configuration->hasExtensions()); |
| 2304 | + $this->assertSame(['ExtensionClass'], $configuration->extensions()); |
| 2305 | + } |
| 2306 | + |
| 2307 | + public function testExtensionMayNotBeConfigured(): void |
| 2308 | + { |
| 2309 | + $configuration = (new Builder)->fromParameters([]); |
| 2310 | + |
| 2311 | + $this->assertFalse($configuration->hasExtensions()); |
| 2312 | + |
| 2313 | + $this->expectException(Exception::class); |
| 2314 | + |
| 2315 | + $configuration->extensions(); |
| 2316 | + } |
| 2317 | + |
2266 | 2318 | public function testInvalidOption(): void |
2267 | 2319 | { |
2268 | 2320 | $this->expectException(Exception::class); |
|
0 commit comments