ModuleTest::testTowModulesAreEqual()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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