GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ParameterTest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 71
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A testConstructDescription() 0 12 1
A testConstructWithoutDescription() 0 6 1
A testNoDefaultValue() 0 5 1
A testDefaultValue() 0 8 1
A testNullValue() 0 8 1
1
<?php
2
namespace Naneau\FileGen\Test\Parameter;
3
4
use Naneau\FileGen\Parameter\Set as ParameterSet;
5
use Naneau\FileGen\Parameter\Parameter;
6
7
class ParameterTest extends \PHPUnit\Framework\TestCase
8
{
9
    /**
10
     * Test description constructor
11
     *
12
     * @return void
13
     **/
14
    public function testConstructDescription()
15
    {
16
        $param = new Parameter('foo', 'bar');
17
        $this->assertEquals(
18
            'foo',
19
            $param->getName()
20
        );
21
        $this->assertEquals(
22
            'bar',
23
            $param->getDescription()
24
        );
25
    }
26
27
    /**
28
     * no description given test
29
     *
30
     * @return void
31
     **/
32
    public function testConstructWithoutDescription()
33
    {
34
        $param = new Parameter('foo');
35
        $this->assertEquals('foo', $param->getName());
36
        $this->assertEquals('foo', $param->getDescription());
37
    }
38
39
    /**
40
     * No default value
41
     *
42
     * @return void
43
     **/
44
    public function testNoDefaultValue()
45
    {
46
        $param = new Parameter('foo');
47
        $this->assertFalse($param->hasDefaultValue());
48
    }
49
50
    /**
51
     * Default value
52
     *
53
     * @return void
54
     **/
55
    public function testDefaultValue()
56
    {
57
        $param = new Parameter('foo');
58
        $param->setDefaultValue('bar');
59
60
        $this->assertTrue($param->hasDefaultValue());
61
        $this->assertEquals('bar', $param->getDefaultValue());
62
    }
63
64
    /**
65
     * Default value `null`
66
     *
67
     * @return void
68
     **/
69
    public function testNullValue()
70
    {
71
        $param = new Parameter('foo');
72
        $param->setDefaultValue(null);
73
74
        $this->assertTrue($param->hasDefaultValue());
75
        $this->assertEquals(null, $param->getDefaultValue());
76
    }
77
}
78