ModuleTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testConstructor() 0 8 1
A testInvalidArgumentsInConstructor() 0 7 1
A testTowModulesAreEqual() 0 12 1
1
<?php
2
3
namespace Wambo\Core\Module;
4
5
use PHPUnit\Framework\TestCase;
6
7
/**
8
 * Class ModuleTest
9
 * @package Wambo\Core\Module
10
 */
11
class ModuleTest extends TestCase
12
{
13
14
    /**
15
     * @test
16
     */
17
    public function testConstructor()
18
    {
19
        // arrange
20
        $module = new Module('Test', 'v2.14.3', 'Wambo\\Test\\Boostrap');
21
22
        // assert
23
        $this->assertInstanceOf('Wambo\Core\Module\Module', $module);
24
    }
25
26
    /**
27
     * @test
28
     * @expectedException \Wambo\Core\Module\Exception\InvalidArgumentException
29
     */
30
    public function testInvalidArgumentsInConstructor()
31
    {
32
        // ToDo: more test with invalid namespaces and module names
33
34
        // arrange
35
        new Module('', '', '');
36
    }
37
38
    /**
39
     * @test
40
     */
41
    public function testTowModulesAreEqual()
42
    {
43
        // arrange
44
        $moduleA = new Module('Test', 'v4.32.3', 'Wambo\\Test\\Boostrap');
45
        $moduleB = new Module('Test', 'v4.32.3', 'Wambo\\Test\\Boostrap');
46
47
        // act
48
        $isEqual = $moduleA->equals($moduleB);
49
50
        // assert
51
        $this->assertTrue($isEqual, true);
52
    }
53
54
}
55