Passed
Branch tests (8e1d8e)
by Nicolas
02:56
created

TypeProviderTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetTypes() 0 12 1
A testGetType() 0 10 1
1
<?php
2
3
namespace Tests\Cp\Provider;
4
5
use Cp\Provider\TypeProvider;
6
7
/**
8
 * Class TypeProviderTest
9
 */
10
class TypeProviderTest extends \PHPUnit_Framework_TestCase
11
{
12
    /**
13
     * Test if types are right
14
     */
15
    public function testGetTypes()
16
    {
17
        $typeProvider = new TypeProvider();
18
19
        $expected = [
20
            'plan-entrainement-10km',
21
            'plan-entrainement-semi-marathon',
22
            'plan-entrainement-marathon',
23
        ];
24
25
        $this->assertEquals($expected, $typeProvider->getTypes());
26
    }
27
28
    /**
29
     * Test return type available
30
     */
31
    public function testGetType()
32
    {
33
        $typeProvider = new TypeProvider();
34
35
        $this->assertEquals('plan-entrainement-10km', $typeProvider->getType('plan-entrainement-10km'));
36
        $this->assertEquals('plan-entrainement-semi-marathon', $typeProvider->getType('plan-entrainement-semi-marathon'));
37
        $this->assertEquals('plan-entrainement-marathon', $typeProvider->getType('plan-entrainement-marathon'));
38
39
        $this->assertEquals(null, $typeProvider->getType('fake'));
40
    }
41
}
42