Fixed test. Removed Mercure from test env
testing/ogcore-api/pipeline/head This commit looks good
Details
testing/ogcore-api/pipeline/head This commit looks good
Details
parent
5a63a1fb88
commit
721ad0d591
|
@ -10,6 +10,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpKernel\Event\ViewEvent;
|
use Symfony\Component\HttpKernel\Event\ViewEvent;
|
||||||
use Symfony\Component\HttpKernel\KernelEvents;
|
use Symfony\Component\HttpKernel\KernelEvents;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
use Symfony\Component\HttpKernel\KernelInterface;
|
||||||
use Symfony\Component\Mercure\HubInterface;
|
use Symfony\Component\Mercure\HubInterface;
|
||||||
use Symfony\Component\Mercure\Update;
|
use Symfony\Component\Mercure\Update;
|
||||||
|
|
||||||
|
@ -19,7 +20,8 @@ class MercureSubscriber implements EventSubscriberInterface
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
LoggerInterface $logger,
|
LoggerInterface $logger,
|
||||||
private readonly HubInterface $hub
|
private readonly HubInterface $hub,
|
||||||
|
private readonly KernelInterface $kernel
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
|
@ -34,6 +36,10 @@ class MercureSubscriber implements EventSubscriberInterface
|
||||||
|
|
||||||
public function onKernelView(ViewEvent $event): void
|
public function onKernelView(ViewEvent $event): void
|
||||||
{
|
{
|
||||||
|
if ('test' === $this->kernel->getEnvironment()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$request = $event->getRequest();
|
$request = $event->getRequest();
|
||||||
$method = $request->getMethod();
|
$method = $request->getMethod();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue