From 0b2bdd196ff53a81692d45f6992ed97df410a995 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 2 Aug 2013 16:16:04 +0200 Subject: [PATCH] fix broken tests --- core/lib/Thelia/Action/Cart.php | 2 +- core/lib/Thelia/Tests/Action/CartTest.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/lib/Thelia/Action/Cart.php b/core/lib/Thelia/Action/Cart.php index e4255aa30..28b5b7531 100755 --- a/core/lib/Thelia/Action/Cart.php +++ b/core/lib/Thelia/Action/Cart.php @@ -205,7 +205,7 @@ class Cart implements EventSubscriberInterface $session->setCart($newCart->getId()); $cartEvent = new CartEvent($newCart); - $this->dispatcher->dispatch(TheliaEvents::CART_DUPLICATE, $newCart); + $this->dispatcher->dispatch(TheliaEvents::CART_DUPLICATE, $cartEvent); return $cartEvent->cart; } diff --git a/core/lib/Thelia/Tests/Action/CartTest.php b/core/lib/Thelia/Tests/Action/CartTest.php index 4b9712efc..fb56f1f73 100644 --- a/core/lib/Thelia/Tests/Action/CartTest.php +++ b/core/lib/Thelia/Tests/Action/CartTest.php @@ -50,9 +50,13 @@ class CartTest extends \PHPUnit_Framework_TestCase $this->uniqid = uniqid('', true); + $dispatcher = $this->getMock("Symfony\Component\EventDispatcher\EventDispatcherInterface"); + $this->actionCart = $this->getMock( "\Thelia\Action\Cart", - array("generateCookie") + array("generateCookie"), + array($dispatcher) + ); $this->actionCart