Completed
Push — master ( 203e38...2cdd54 )
by Gerrit
13:04
created

ServiceMappingTest   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 12 1
A shouldKnowItsServiceId() 0 4 1
A shouldKnowItsOrigin() 0 4 1
A shouldHaveNoColumns() 0 4 1
A shouldKnowIfLaxOrNot() 0 4 1
A shouldBeNotLaxByDefault() 0 4 1
A shouldNotKnowItsOriginByDefault() 0 4 1
1
<?php
2
/**
3
 * Copyright (C) 2017  Gerrit Addiks.
4
 * This package (including this file) was released under the terms of the GPL-3.0.
5
 * You should have received a copy of the GNU General Public License along with this program.
6
 * If not, see <http://www.gnu.org/licenses/> or send me a mail so i can send you a copy.
7
 * @license GPL-3.0
8
 * @author Gerrit Addiks <[email protected]>
9
 */
10
11
namespace Addiks\RDMBundle\Tests\Mapping;
12
13
use PHPUnit\Framework\TestCase;
14
use Addiks\RDMBundle\Mapping\ServiceMapping;
15
16
final class ServiceMappingTest extends TestCase
17
{
18
19
    /**
20
     * @var ServiceMapping
21
     */
22
    private $serviceMapping;
23
24
    /**
25
     * @var ServiceMapping
26
     */
27
    private $defaultServiceMapping;
28
29
    public function setUp()
30
    {
31
        $this->serviceMapping = new ServiceMapping(
32
            "some_service_id",
33
            true,
34
            "some origin"
35
        );
36
37
        $this->defaultServiceMapping = new ServiceMapping(
38
            "some_default_service_id"
39
        );
40
    }
41
42
    /**
43
     * @test
44
     */
45
    public function shouldKnowItsServiceId()
46
    {
47
        $this->assertEquals("some_service_id", $this->serviceMapping->getServiceId());
48
    }
49
50
    /**
51
     * @test
52
     */
53
    public function shouldKnowItsOrigin()
54
    {
55
        $this->assertEquals("some origin", $this->serviceMapping->describeOrigin());
56
    }
57
58
    /**
59
     * @test
60
     */
61
    public function shouldHaveNoColumns()
62
    {
63
        $this->assertEquals([], $this->serviceMapping->collectDBALColumns());
64
    }
65
66
    /**
67
     * @test
68
     */
69
    public function shouldKnowIfLaxOrNot()
70
    {
71
        $this->assertEquals(true, $this->serviceMapping->isLax());
72
    }
73
74
    /**
75
     * @test
76
     */
77
    public function shouldBeNotLaxByDefault()
78
    {
79
        $this->assertEquals(false, $this->defaultServiceMapping->isLax());
80
    }
81
82
    /**
83
     * @test
84
     */
85
    public function shouldNotKnowItsOriginByDefault()
86
    {
87
        $this->assertEquals("unknown", $this->defaultServiceMapping->describeOrigin());
88
    }
89
90
}
91