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

ListCommandTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 3
dl 0
loc 35
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testBasicList() 0 6 1
A testMagentoCatalogOccurs() 0 4 1
A testVendorList() 0 8 1
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