mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-10 14:27:28 +01:00
40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
|
<?php
|
||
|
namespace Tests\Unit\Entity\Subscriber;
|
||
|
|
||
|
use App\Subscriber\SourceMenuSubscriber;
|
||
|
use App\Subscriber\UserMenuSubscriber;
|
||
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
|
||
|
use Symfony\Component\Translation\Translator;
|
||
|
use App\Event\Menu\MenuEvent;
|
||
|
use PHPUnit\Framework\TestCase;
|
||
|
use Knp\Menu\FactoryInterface;
|
||
|
use Knp\Menu\ItemInterface;
|
||
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||
|
|
||
|
class SourceMenuSubscriberTest extends TestCase
|
||
|
{
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
* @var SourceMenuSubscriber
|
||
|
*/
|
||
|
public $subscriber;
|
||
|
|
||
|
public function setUp(): void
|
||
|
{
|
||
|
$translator = new Translator('en');
|
||
|
$this->subscriber = new SourceMenuSubscriber($translator);
|
||
|
}
|
||
|
|
||
|
public function testOnSourceMenuConfig():void{
|
||
|
$factory = $this->createMock(FactoryInterface::class);
|
||
|
$item = $this->createMock(ItemInterface::class);
|
||
|
$request = $this->createMock(RequestStack::class);
|
||
|
$event = new MenuEvent($factory, $item, $request);
|
||
|
$this->assertNull($this->subscriber->onSourceMenuConfigure($event));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|