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

TypeProviderTest::testGetTypes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

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