Esempio n. 1
0
 function it_sets_cart_identifier_via_session($session, CartInterface $cart)
 {
     $cart->getIdentifier()->will(function () {
         return 3;
     });
     $session->set(SessionCartStorage::KEY, 3)->will(function () use($session) {
         $session->get(SessionCartStorage::KEY)->willReturn(3);
     });
     $this->setCurrentCartIdentifier($cart);
     $this->getCurrentCartIdentifier()->shouldReturn(3);
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function setCurrentCartIdentifier(CartInterface $cart)
 {
     $this->session->set($this->key, $cart->getIdentifier());
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function setCurrentCartIdentifier(CartInterface $cart)
 {
     $this->storage->setData(self::STORAGE_KEY, $cart->getIdentifier());
 }