From 8d81b63c124fd5c8ed6a634d2107a570f9d9ffe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pysiak?= Date: Mon, 23 Oct 2023 11:26:33 +0200 Subject: [PATCH] WIP --- .../ShippingExportEventListenerSpec.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/spec/EventListener/ShippingExportEventListenerSpec.php b/spec/EventListener/ShippingExportEventListenerSpec.php index 788f0c3..ab7cf7a 100644 --- a/spec/EventListener/ShippingExportEventListenerSpec.php +++ b/spec/EventListener/ShippingExportEventListenerSpec.php @@ -12,7 +12,10 @@ use Sylius\Component\Core\Model\Order; use Sylius\Component\Core\Model\ShipmentInterface; use Symfony\Component\Filesystem\Filesystem; +use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; +use Symfony\Component\HttpFoundation\Session\Session; +use Symfony\Component\HttpFoundation\Session\SessionInterface; final class ShippingExportEventListenerSpec extends ObjectBehavior { @@ -23,12 +26,12 @@ function it_is_initializable() function let ( WebClientInterface $webClient, - FlashBagInterface $flashBag, + RequestStack $requestStack, Filesystem $filesystem, ObjectManager $objectManager ) { $shippingLabelsPath = 'labels'; - $this->beConstructedWith($webClient, $flashBag, $filesystem, $objectManager, $shippingLabelsPath); + $this->beConstructedWith($webClient, $requestStack, $filesystem, $objectManager, $shippingLabelsPath); } function it_export_shipment @@ -38,10 +41,15 @@ function it_export_shipment ShippingGatewayInterface $shippingGateway, ShipmentInterface $shipment, WebClientInterface $webClient, - Order $order + Order $order, + RequestStack $requestStack, + Session $session, + FlashBagInterface $flashBag, ) { $webClient->setShippingGateway($shippingGateway); + $requestStack->getSession()->willReturn($session); + $session->getFlashBag()->willReturn($flashBag); $shippingGateway->getCode()->willReturn(ShippingExportEventListener::DPD_GATEWAY_CODE);