function it_throw_exception_if_subject_is_not_a_cart(GenericEvent $event, CartInterface $cart) { $event->getSubject()->shouldBeCalled()->willReturn(null); $cart->calculateTotal()->shouldNotBeCalled(); $this->shouldThrow('\\InvalidArgumentException')->during('refreshCart', array($event)); }