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

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

public it_returns_cart_based_on_id_stored_in_session_and_current_channel ( Symfony\Component\HttpFoundation\Session\SessionInterface $session, Sylius\Component\Core\Repository\OrderRepositoryInterface $orderRepository, Sylius\Component\Channel\Context\ChannelContextInterface $channelContext, Sylius\Component\Core\Model\ChannelInterface $channel, Sylius\Component\Order\Model\OrderInterface $cart )
$session Symfony\Component\HttpFoundation\Session\SessionInterface
$orderRepository Sylius\Component\Core\Repository\OrderRepositoryInterface
$channelContext Sylius\Component\Channel\Context\ChannelContextInterface
$channel Sylius\Component\Core\Model\ChannelInterface
$cart Sylius\Component\Order\Model\OrderInterface
    function it_returns_cart_based_on_id_stored_in_session_and_current_channel(SessionInterface $session, OrderRepositoryInterface $orderRepository, ChannelContextInterface $channelContext, ChannelInterface $channel, OrderInterface $cart)
    {
        $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($cart);
        $this->getCart()->shouldReturn($cart);
    }