Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-mw committed Sep 9, 2021
1 parent 87a3d92 commit ad056fa
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/MicroweberPackages/Customer/tests/CustomerCheckoutTest.php
Expand Up @@ -19,22 +19,27 @@ class CustomerCheckoutTest extends TestCase

private function _addProductToCart($title)
{
app()->database_manager->extended_save_set_permission(true);

$productPrice = rand(1, 4444);
$productPrice = rand(100, 4444);

$params = array(
'title' => $title,
'content_type' => 'product',
'subtype' => 'product',
'custom_fields' => array(
'custom_fields_advanced' => array(
array('type' => 'dropdown', 'name' => 'Color', 'value' => array('Purple', 'Blue')),
array('type' => 'price', 'name' => 'Price', 'value' => '9.99'),
array('type' => 'price', 'name' => 'Price', 'value' => $productPrice),

),
'is_active' => 1,);


$saved_id = save_content($params);
$prices_data = app()->shop_manager->get_product_prices($saved_id, false);
$this->assertEquals($prices_data['Price'],$productPrice);


$get = get_content_by_id($saved_id);

$this->assertEquals($saved_id, ($get['id']));
Expand All @@ -45,7 +50,7 @@ private function _addProductToCart($title)
'price' => $productPrice,
);
$cart_add = update_cart($add_to_cart);

$this->assertEquals(isset($cart_add['success']), true);
$this->assertEquals(isset($cart_add['product']), true);
$this->assertEquals($cart_add['product']['price'], $productPrice);
Expand Down

0 comments on commit ad056fa

Please sign in to comment.