Passed
Pull Request — master (#10)
by Anatoly
02:48
created

GenerateOpenApiDocumentCommandTest::testExecute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 12
rs 10
1
<?php declare(strict_types=1);
2
3
namespace App\Tests\Command;
4
5
/**
6
 * Import classes
7
 */
8
use App\Tests\ContainerAwareTrait;
9
use PHPUnit\Framework\TestCase;
10
use Symfony\Component\Console\Application;
11
use Symfony\Component\Console\Tester\CommandTester;
12
13
/**
14
 * GenerateOpenApiDocumentCommandTest
15
 */
16
class GenerateOpenApiDocumentCommandTest extends TestCase
17
{
18
    use ContainerAwareTrait;
19
20
    /**
21
     * @return void
22
     *
23
     * @runInSeparateProcess
24
     */
25
    public function testExecute() : void
26
    {
27
        $container = $this->getContainer();
28
29
        $application = new Application();
30
        $application->addCommands($container->get('commands'));
31
32
        $command = $application->find('app:openapi:generate-document');
33
        $commandTester = new CommandTester($command);
34
35
        $commandTester->execute([]);
36
        $this->assertSame(0, $commandTester->getStatusCode());
37
    }
38
}
39