Skip to content

Commit

Permalink
Merge pull request #2360 from deZinc/test-adminlist-MenuAdaptors
Browse files Browse the repository at this point in the history
[AdminBundle] added ModulesMenuAdaptorTest
  • Loading branch information
acrobat committed Feb 12, 2019
2 parents 79cbbc8 + 1fbe509 commit 07bf3dc
Showing 1 changed file with 35 additions and 0 deletions.
@@ -0,0 +1,35 @@
<?php

namespace Kunstmaan\AdminBundle\Tests\Helper\Menu;

use Kunstmaan\AdminBundle\Helper\Menu\MenuAdaptorInterface;
use Kunstmaan\AdminBundle\Helper\Menu\MenuBuilder;
use Kunstmaan\AdminBundle\Helper\Menu\ModulesMenuAdaptor;
use Kunstmaan\AdminBundle\Helper\Menu\TopMenuItem;
use PHPUnit\Framework\TestCase;
use Symfony\Component\HttpFoundation\Request;

class ModulesMenuAdaptorTest extends TestCase
{
public function testAdaptChildren()
{
$children = [];

/** @var MenuBuilder $menuBuilderMock */
$menuBuilderMock = $this->createMock(MenuBuilder::class);

/** @var Request $request */
$request = new Request([], [], ['_route' => 'KunstmaanAdminBundle_modules']);

$moduleMenuAdaptor = new ModulesMenuAdaptor();
$moduleMenuAdaptor->adaptChildren($menuBuilderMock, $children, null, $request);

$this->assertContainsOnlyInstancesOf(TopMenuItem::class, $children);
}

public function testHasInterface()
{
$moduleMenuAdaptor = new ModulesMenuAdaptor();
$this->assertInstanceOf(MenuAdaptorInterface::class, $moduleMenuAdaptor);
}
}

0 comments on commit 07bf3dc

Please sign in to comment.