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

ModuleTest::testGetConsoleUsage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
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