Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function it_returns_total_quantity_in_cart(CartItem $cartItem1, CartItem $cartItem2, ..., CartItemQuantity $cartItemQuantity, ...)
- {
- $cartItemQuantity->asInt()->willReturn(3);
- $cartItem1->beConstructedWith([..., $cartItemQuantity->getWrappedObject(), ...]);
- $cartItem1->getQuantity()->willReturn($cartItemQuantity);
- $this->add($cartItem1);
- $this->add($cartItem2);
- $this->getTotalQuantity()->shouldReturn(3);
- }
- //
- //it returns total quantity in cart
- // 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.
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement