From b30f64e40ca62eaa4005e4ac45dcd086dee40c59 Mon Sep 17 00:00:00 2001 From: Rob Gloudemans Date: Mon, 8 Jul 2013 22:47:54 +0200 Subject: [PATCH] Updated unit tests --- tests/CartTest.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/CartTest.php b/tests/CartTest.php index a6408a5..482ba3d 100644 --- a/tests/CartTest.php +++ b/tests/CartTest.php @@ -10,9 +10,17 @@ class CartTest extends TestCase { $this->assertInstanceOf('Gloudemans\Shoppingcart\CartCollection', Cart::content()); } + public function testCartCanAddArray() + { + Cart::add(['id' => 1, 'name' => 'test', 'qty' => 1, 'price' => 10.00, 'options' => ['size' => 'L']]); + + $this->assertEquals(Cart::count(), 1); + $this->assertInstanceOf('Gloudemans\Shoppingcart\CartCollection', Cart::content()); + } + public function testCartCanAddBatch() { - Cart::addBatch([ + Cart::add([ ['id' => 1, 'name' => 'test_1', 'qty' => 1, 'price' => 10.00], ['id' => 2, 'name' => 'test_2', 'qty' => 1, 'price' => 10.00, 'options' => ['size' => 'large']] ]);