spec\Sylius\Bundle\CoreBundle\Context\SessionAndChannelBasedCartContextSpec::it_throws_cart_not_found_exception_and_removes_id_from_session_when_cart_was_not_found PHP Метод

it_throws_cart_not_found_exception_and_removes_id_from_session_when_cart_was_not_found() публичный Метод

public it_throws_cart_not_found_exception_and_removes_id_from_session_when_cart_was_not_found ( Symfony\Component\HttpFoundation\Session\SessionInterface $session, Sylius\Component\Core\Repository\OrderRepositoryInterface $orderRepository, Sylius\Component\Channel\Context\ChannelContextInterface $channelContext, Sylius\Component\Core\Model\ChannelInterface $channel )
$session Symfony\Component\HttpFoundation\Session\SessionInterface
$orderRepository Sylius\Component\Core\Repository\OrderRepositoryInterface
$channelContext Sylius\Component\Channel\Context\ChannelContextInterface
$channel Sylius\Component\Core\Model\ChannelInterface
    function it_throws_cart_not_found_exception_and_removes_id_from_session_when_cart_was_not_found(SessionInterface $session, OrderRepositoryInterface $orderRepository, ChannelContextInterface $channelContext, ChannelInterface $channel)
    {
        $channelContext->getChannel()->willReturn($channel);
        $channel->getCode()->willReturn('Poland');
        $session->has('session_key_name.Poland')->willReturn(true);
        $session->get('session_key_name.Poland')->willReturn(12345);
        $orderRepository->findCartByChannel(12345, $channel)->willReturn(null);
        $session->remove('session_key_name.Poland')->shouldBeCalled();
        $this->shouldThrow(CartNotFoundException::class)->during('getCart');
    }