ModuleMapperTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCreate_Fail() 0 10 1
A testCreate_Success() 0 16 1
1
<?php
2
3
namespace Wambo\Core\Module;
4
5
use PHPUnit\Framework\TestCase;
6
use Wambo\Core\Module\Exception\InvalidArgumentException;
7
8
class ModuleMapperTest extends TestCase
9
{
10
11
    public function testCreate_Success()
12
    {
13
        // arrange
14
        $mapper = new ModuleMapper();
15
        $data = array(
16
            'name' => 'Test',
17
            'version' => 'v0.3.1',
18
            'class' => 'Wambo\\Test\\Bootstrap'
19
        );
20
21
        // act
22
        $module = $mapper->getModule($data);
23
24
        //assert
25
        $this->assertInstanceOf('\Wambo\Core\Module\Module', $module);
26
    }
27
28
    /**
29
     * @test
30
     * @expectedException InvalidArgumentException
31
     */
32
    public function testCreate_Fail()
33
    {
34
        //arrange
35
        $mapper = new ModuleMapper();
36
        $data = array();
37
38
        //act
39
        $mapper->getModule($data);
40
41
    }
42
}