Completed
Push — develop ( f11aab...a4697b )
by Alejandro
09:31
created

ModuleTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetConfig() 0 7 1
A testGetConsoleUsage() 0 10 1
A setUp() 0 4 1
1
<?php
2
namespace AcMailerTest;
3
4
use AcMailer\Module;
5
use AcMailerTest\Console\AdapterMock;
6
use PHPUnit_Framework_TestCase as TestCase;
7
8
/**
9
 * Class ModuleTest
10
 * @author Alejandro Celaya Alastrué
11
 * @link http://www.alejandrocelaya.com
12
 */
13
class ModuleTest extends TestCase
14
{
15
    /**
16
     * @var Module
17
     */
18
    private $module;
19
20
    public function setUp()
21
    {
22
        $this->module = new Module();
23
    }
24
25
    public function testGetConfig()
26
    {
27
        $expectedConfig = include __DIR__ . '/../config/module.config.php';
28
        $returnedConfig = $this->module->getConfig();
29
30
        $this->assertEquals($expectedConfig, $returnedConfig);
31
    }
32
33
    public function testGetConsoleUsage()
34
    {
35
        $this->assertEquals(
36
            [
37
                'acmailer parse-config [--configKey=] [--format=(php|xml|ini|json)] [--outputFile=]'
38
                => 'Parses the configuration of AcMailer module <=v4.5.1 to the structure used in v5.0.0'
39
            ],
40
            $this->module->getConsoleUsage(new AdapterMock())
41
        );
42
    }
43
}
44