Passed
Push — bugfix/support-windows ( 0e99e7...b5ecf8 )
by Jesús
06:33 queued 02:55
created

ListModulesCommandTest::test_list_modules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 12
nc 1
nop 0
dl 0
loc 18
rs 9.8666
c 0
b 0
f 0
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 ListModulesCommandTest 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
        $out = $output->fetch();
27
28
        self::assertMatchesRegularExpression('#TestModule1.*ListModules\\\TestModule1#', $out);
29
        self::assertMatchesRegularExpression('#TestModule2.*ListModules\\\TestModule2#', $out);
30
        self::assertMatchesRegularExpression('#TestModule3.*ListModules\\\LevelUp\\\TestModule3#', $out);
31
        self::assertStringNotContainsString('vendor', $out);
32
        self::assertStringNotContainsString('ToBeIgnored', $out);
33
    }
34
}
35