aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/opencart/catalog/controller/checkout/CartTest.php
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-08-18 21:14:58 -0500
committerJesús <heckyel@hyperbola.info>2019-08-18 21:14:58 -0500
commit2eed7b082f83630301e51f57ca8394de228a8605 (patch)
tree1d19962d22d30f99317d9276e4bae7744fc93fc2 /tests/phpunit/opencart/catalog/controller/checkout/CartTest.php
downloadlibrecart-2eed7b082f83630301e51f57ca8394de228a8605.tar.lz
librecart-2eed7b082f83630301e51f57ca8394de228a8605.tar.xz
librecart-2eed7b082f83630301e51f57ca8394de228a8605.zip
first commit
Diffstat (limited to 'tests/phpunit/opencart/catalog/controller/checkout/CartTest.php')
-rw-r--r--tests/phpunit/opencart/catalog/controller/checkout/CartTest.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/phpunit/opencart/catalog/controller/checkout/CartTest.php b/tests/phpunit/opencart/catalog/controller/checkout/CartTest.php
new file mode 100644
index 0000000..5db180d
--- /dev/null
+++ b/tests/phpunit/opencart/catalog/controller/checkout/CartTest.php
@@ -0,0 +1,22 @@
+<?php
+
+class CatalogControllerCheckoutCartTest extends OpenCartTest {
+
+ /**
+ * @before
+ */
+ public function setupTest() {
+ $this->cart->clear();
+ }
+
+ public function testAddProduct() {
+ $this->request->post['product_id'] = 28;
+ $this->request->post['quantity'] = 1;
+
+ $response = json_decode($this->dispatchAction("checkout/cart/add")->getOutput(), true);
+
+ $this->assertTrue(!empty($response['success']) && !empty($response['total']));
+ $this->assertEquals(1, preg_match('/HTC Touch HD/', $response['success']));
+ $this->assertEquals(1, preg_match('/122\.00/', $response['total']));
+ }
+}