MenuRepositoryTest::it_creates_menu()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 7
rs 9.4286
cc 1
eloc 4
nc 1
nop 0
1
<?php namespace Modules\Menu\Tests;
2
3
class MenuRepositoryTest extends BaseMenuTest
4
{
5
    /** @test */
6
    public function it_creates_menu()
7
    {
8
        $menu = $this->createMenu('main', 'Main Menu');
9
10
        $this->assertEquals(1, $this->menu->find($menu->id)->count());
11
        $this->assertEquals($menu->name, $this->menu->find($menu->id)->name);
12
    }
13
14
    public function it_should_create_root_item_when_creating_new_menu()
15
    {
16
        $menu = $this->createMenu('main', 'Main Menu');
17
18
        $items = $this->menuItem->allRootsForMenu($menu->id);
0 ignored issues
show
Unused Code introduced by
$items is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
19
    }
20
}
21