diff --git a/tests/MenuItemTest.php b/tests/MenuItemTest.php index f814c54..cf1553c 100644 --- a/tests/MenuItemTest.php +++ b/tests/MenuItemTest.php @@ -4,6 +4,7 @@ use Akaunting\Menu\Menu; use Akaunting\Menu\MenuItem; +use Illuminate\Support\Arr; class MenuItemTest extends TestCase { @@ -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() { @@ -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()); @@ -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); @@ -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]); } @@ -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); @@ -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); } @@ -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); @@ -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()); }