Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <?php
  2. function it_returns_total_quantity_in_cart(CartItem $cartItem1, CartItem $cartItem2, ..., CartItemQuantity $cartItemQuantity, ...)
  3.     {
  4.         $cartItemQuantity->asInt()->willReturn(3);
  5.         $cartItem1->beConstructedWith([..., $cartItemQuantity->getWrappedObject(), ...]);
  6.         $cartItem1->getQuantity()->willReturn($cartItemQuantity);
  7.         $this->add($cartItem1);
  8.         $this->add($cartItem2);
  9.         $this->getTotalQuantity()->shouldReturn(3);
  10.     }
  11. //
  12. //it returns total quantity in cart
  13. //      exception [err:TypeError("Return value of Double\App\Domain\Webshop\CartItem\P7::getQuantity() must be an instance of //App\Domain\Webshop\CartItemQuantity, null returned")] has been thrown.
  14. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement