2018-11-04 15:11:16 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Event;
|
|
|
|
|
2019-02-17 14:33:19 +01:00
|
|
|
use Infinito\Event\Menu\MenuEvent;
|
2018-11-04 15:11:16 +01:00
|
|
|
use Knp\Menu\FactoryInterface;
|
|
|
|
use Knp\Menu\ItemInterface;
|
2020-04-02 21:13:35 +02:00
|
|
|
use PHPUnit\Framework\TestCase;
|
2018-11-04 15:11:16 +01:00
|
|
|
use Symfony\Component\HttpFoundation\RequestStack;
|
|
|
|
|
|
|
|
class MenuEventTest extends TestCase
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var MenuEvent
|
|
|
|
*/
|
|
|
|
protected $menuEvent;
|
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
|
|
|
$factory = $this->createMock(FactoryInterface::class);
|
|
|
|
$item = $this->createMock(ItemInterface::class);
|
|
|
|
$request = $this->createMock(RequestStack::class);
|
|
|
|
$this->menuEvent = new MenuEvent($factory, $item, $request);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testConstructor(): void
|
|
|
|
{
|
|
|
|
$this->assertInstanceOf(FactoryInterface::class, $this->menuEvent->getFactory());
|
|
|
|
$this->assertInstanceOf(ItemInterface::class, $this->menuEvent->getItem());
|
|
|
|
$this->assertInstanceOf(RequestStack::class, $this->menuEvent->getRequest());
|
|
|
|
}
|
|
|
|
}
|