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

ListModulesCommandTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_list_modules() 0 18 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 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