Completed
Push — develop ( 7623eb...611a18 )
by Tom
03:37
created

ListCommandTest::setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace N98\Magento\Command\Developer\Module;
4
5
use N98\Magento\Command\TestCase;
6
7
class ListCommandTest extends TestCase
8
{
9
    const NONEXISTENT_VENDOR = 'FAKE_VENDOR';
10
    const MODULE_OCCURENCE_CHECK = 'Magento_Catalog';
11
12
    /**
13
     * Test whether the $moduleList property is filled
14
     */
15
    public function testBasicList()
16
    {
17
        /* @var $command ListCommand */
18
        $command = $this->assertExecute('dev:module:list')->getCommand();
19
        $this->assertNotEmpty($command->getModuleList());
20
    }
21
22
    /**
23
     * Sanity test to check whether Magento_Core occurs in the output
24
     */
25
    public function testMagentoCatalogOccurs()
26
    {
27
        $this->assertDisplayContains('dev:module:list', self::MODULE_OCCURENCE_CHECK);
28
    }
29
30
    /**
31
     * Test whether we can filter on vendor (by checking a non-existent vendor, we should get an empty list)
32
     */
33
    public function testVendorList()
34
    {
35
        /* @var $command ListCommand */
36
        $command = $this->assertExecute(
37
            array('command' => 'dev:module:list', '--vendor' => self::NONEXISTENT_VENDOR)
38
        )->getCommand();
39
        $this->assertEmpty($command->getModuleList());
40
    }
41
}
42