Passed
Push — add-command-list-modules ( fd1ae6 )
by Chema
11:55
created

MakeModuleCommandTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 17
c 1
b 0
f 0
dl 0
loc 26
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_list_modules() 0 24 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GacelaTest\Feature\Console\ListModules;
6
7
use Gacela\Console\Infrastructure\ConsoleBootstrap;
8
use Gacela\Framework\Gacela;
9
use PHPUnit\Framework\TestCase;
10
use Symfony\Component\Console\Input\StringInput;
11
use Symfony\Component\Console\Output\BufferedOutput;
12
13
final class MakeModuleCommandTest extends TestCase
14
{
15
    public function test_list_modules(): void
16
    {
17
        Gacela::bootstrap(__DIR__);
18
19
        $input = new StringInput('list:modules');
20
        $output = new BufferedOutput();
21
22
        $bootstrap = new ConsoleBootstrap();
23
        $bootstrap->setAutoExit(false);
24
        $bootstrap->run($input, $output);
25
26
        $outputText = $output->fetch();
27
28
        self::assertStringContainsString(
29
            'TestModule1Facade | GacelaTest\Feature\Console\ListModules\TestModule1',
30
            $outputText,
31
        );
32
        self::assertStringContainsString(
33
            'TestModule2Facade | GacelaTest\Feature\Console\ListModules\TestModule2',
34
            $outputText,
35
        );
36
        self::assertStringContainsString(
37
            'TestModule3Facade | GacelaTest\Feature\Console\ListModules\LevelUp\TestModule3',
38
            $outputText,
39
        );
40
    }
41
}
42