packages/deriver/tests/Unit/Command/ApplicationTest.php
1<?php
2
3declare(strict_types=1);
4
5namespace Tests\Unit\Command;
6
7use Deriver\Command\Application;
8use PHPUnit\Framework\Attributes\CoversNothing;
9use PHPUnit\Framework\TestCase;
10use Symfony\Component\Console\Tester\ApplicationTester;
11
12#[CoversNothing]
13final class ApplicationTest extends TestCase
14{
15 public function testRunProvidesHelpWithoutRequiringASelector(): void
16 {
17 $application = new Application();
18 $application->setAutoExit(false);
19 $tester = new ApplicationTester($application);
20 self::assertSame(0, $tester->run(['--help' => true]));
21 self::assertStringContainsString('--config', $tester->getDisplay());
22 self::assertStringContainsString('--include', $tester->getDisplay());
23 self::assertStringContainsString('deliver [options]', $tester->getDisplay());
24 }
25}
26