Skip to content

Commit

Permalink
l6 for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Oct 17, 2019
1 parent cab2e73 commit 3644a96
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions tests/MenuItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Akaunting\Menu\Menu;
use Akaunting\Menu\MenuItem;
use Illuminate\Support\Arr;

class MenuItemTest extends TestCase
{
Expand All @@ -15,10 +16,10 @@ class MenuItemTest extends TestCase
public function setUp() : void
{
parent::setUp();

$this->menu = app(Menu::class);
}

/** @test */
public function it_can_make_an_empty_menu_item()
{
Expand All @@ -41,7 +42,7 @@ public function it_can_set_properties_on_menu_item()
'active' => false,
'order' => 1,
];

$menuItem = MenuItem::make($properties);

$this->assertEquals($properties, $menuItem->getProperties());
Expand All @@ -61,7 +62,7 @@ public function it_can_fill_a_menu_item_with_allowed_properties()
'active' => false,
'order' => 1,
];

$menuItem = MenuItem::make($properties);

$this->assertEquals('my.url', $menuItem->url);
Expand Down Expand Up @@ -127,7 +128,7 @@ public function it_can_make_a_simple_route_menu_item()
$children = $menuItem->getChilds()[0]->getChilds();

$this->assertCount(1, $children);
$childMenuItem = array_first($children);
$childMenuItem = Arr::first($children);
$this->assertEquals('settings.account', $childMenuItem->route[0]);
$this->assertEquals(['user_id' => 1], $childMenuItem->route[1]);
}
Expand All @@ -142,7 +143,7 @@ public function it_can_make_a_route_menu_item()
$children = $menuItem->getChilds()[0]->getChilds();

$this->assertCount(1, $children);
$childMenuItem = array_first($children);
$childMenuItem = Arr::first($children);
$this->assertEquals('settings.account', $childMenuItem->route[0]);
$this->assertEquals(['user_id' => 1], $childMenuItem->route[1]);
$this->assertSame(1, $childMenuItem->order);
Expand All @@ -159,7 +160,7 @@ public function it_can_make_a_simple_url_menu_item()
$children = $menuItem->getChilds()[0]->getChilds();

$this->assertCount(1, $children);
$childMenuItem = array_first($children);
$childMenuItem = Arr::first($children);
$this->assertEquals('settings/account', $childMenuItem->url);
$this->assertEquals('Account', $childMenuItem->title);
}
Expand All @@ -174,7 +175,7 @@ public function it_can_make_a_url_menu_item()
$children = $menuItem->getChilds()[0]->getChilds();

$this->assertCount(1, $children);
$childMenuItem = array_first($children);
$childMenuItem = Arr::first($children);
$this->assertEquals('settings/account', $childMenuItem->url);
$this->assertEquals('Account', $childMenuItem->title);
$this->assertSame(1, $childMenuItem->order);
Expand Down Expand Up @@ -233,7 +234,7 @@ public function it_can_get_the_correct_url_for_route_type()
$sub->route('settings.account', 'Account');
});
$children = $menuItem->getChilds()[0]->getChilds();
$childMenuItem = array_first($children);
$childMenuItem = Arr::first($children);

$this->assertEquals('http://localhost/settings/account', $childMenuItem->getUrl());
}
Expand Down

0 comments on commit 3644a96

Please sign in to comment.