DropDownTest   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 48
rs 10
c 0
b 0
f 0
ccs 21
cts 21
cp 1
wmc 6
lcom 1
cbo 2

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A it_checks_is_dropdown() 0 4 1
A it_checks_has_links_method() 0 6 1
A it_checks_has_links_method_no_links() 0 4 1
A it_checks_active_parentage() 0 4 1
A it_disables_active_parentage() 0 6 1
1
<?php
2
3
namespace Tests;
4
5
use JumpGate\Menu\DropDown;
6
use PHPUnit\Framework\TestCase;
7
8
class DropDownTest extends TestCase
9
{
10
    /**
11
     * @var \JumpGate\Menu\DropDown
12
     */
13
    protected $dropDown;
14
15 5
    public function setUp()
16
    {
17 5
        parent::setUp();
18
19 5
        $this->dropDown = new DropDown();
20 5
    }
21
22
    /** @test */
23 1
    public function it_checks_is_dropdown()
24
    {
25 1
        $this->assertTrue($this->dropDown->isDropDown());
26 1
    }
27
28
    /** @test */
29 1
    public function it_checks_has_links_method()
30
    {
31 1
        $this->dropDown->links[] = 'one';
32
33 1
        $this->assertTrue($this->dropDown->hasLinks());
34 1
    }
35
36
    /** @test */
37 1
    public function it_checks_has_links_method_no_links()
38
    {
39 1
        $this->assertFalse($this->dropDown->hasLinks());
40 1
    }
41
42
    /** @test */
43 1
    public function it_checks_active_parentage()
44
    {
45 1
        $this->assertTrue($this->dropDown->activeParentage());
46 1
    }
47
48
    /** @test */
49 1
    public function it_disables_active_parentage()
50
    {
51 1
        $this->dropDown->disableActiveParentage();
52
53 1
        $this->assertFalse($this->dropDown->activeParentage());
54 1
    }
55
}
56