From 418c6e8c1d5cfe5fba25d4f4c34374e350195139 Mon Sep 17 00:00:00 2001 From: John Carlo Octabio Date: Wed, 22 Jul 2020 14:19:14 +0800 Subject: [PATCH] magento/magento2#108: Clear Shopping Cart - Refactor MFTF and PHP files for PR changes requested --- .../ClearShoppingCartEnableDisableConfigurationTest.xml | 7 +------ app/code/Magento/Checkout/ViewModel/Cart.php | 5 ++++- .../testsuite/Magento/Checkout/ViewModel/CartTest.php | 1 - 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/code/Magento/Checkout/Test/Mftf/Test/ClearShoppingCartEnableDisableConfigurationTest.xml b/app/code/Magento/Checkout/Test/Mftf/Test/ClearShoppingCartEnableDisableConfigurationTest.xml index 5e2690e619436..92a4b9563ab3d 100644 --- a/app/code/Magento/Checkout/Test/Mftf/Test/ClearShoppingCartEnableDisableConfigurationTest.xml +++ b/app/code/Magento/Checkout/Test/Mftf/Test/ClearShoppingCartEnableDisableConfigurationTest.xml @@ -14,6 +14,7 @@ <description value="Verify that disabling the clear shopping cart store configuration will remove the clear shopping cart configuration button from the storefront's shopping cart page. Verify that enabling the configuration will add the button to the page and that the button functions as expected"/> <group value="shoppingCart"/> + <severity value="MAJOR"/> </annotations> <before> <!-- Create simple products and category --> @@ -45,9 +46,6 @@ <!-- Enable clear shopping cart button --> <actionGroup ref="AdminSelectClearShoppingCartConfigurationActionGroup" stepKey="enableClearShoppingCartButton"/> <actionGroup ref="SaveStoreConfigurationActionGroup" stepKey="saveStoreConfiguration1"/> - <actionGroup ref="CliCacheCleanActionGroup" stepKey="cliCacheClean1"> - <argument name="tags" value=""/> - </actionGroup> <!-- Open product 1 and add to cart --> <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProduct1Page1"> @@ -74,9 +72,6 @@ <argument name="value" value="{{DisableClearShoppingCart.textValue}}"/> </actionGroup> <actionGroup ref="SaveStoreConfigurationActionGroup" stepKey="saveStoreConfiguration2"/> - <actionGroup ref="CliCacheCleanActionGroup" stepKey="cliCacheClean2"> - <argument name="tags" value=""/> - </actionGroup> <!-- Open product 1 page and add to cart --> <actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProduct1Page2"> diff --git a/app/code/Magento/Checkout/ViewModel/Cart.php b/app/code/Magento/Checkout/ViewModel/Cart.php index 21fe090249a92..f5415079d396e 100644 --- a/app/code/Magento/Checkout/ViewModel/Cart.php +++ b/app/code/Magento/Checkout/ViewModel/Cart.php @@ -11,12 +11,15 @@ use Magento\Framework\View\Element\Context; use Magento\Store\Model\ScopeInterface; +/** + * Cart form view model. + */ class Cart implements ArgumentInterface { /** * Config settings path to enable clear shopping cart button */ - public const XPATH_CONFIG_ENABLE_CLEAR_SHOPPING_CART = 'checkout/cart/enable_clear_shopping_cart'; + private const XPATH_CONFIG_ENABLE_CLEAR_SHOPPING_CART = 'checkout/cart/enable_clear_shopping_cart'; /** * @var ScopeConfigInterface diff --git a/dev/tests/integration/testsuite/Magento/Checkout/ViewModel/CartTest.php b/dev/tests/integration/testsuite/Magento/Checkout/ViewModel/CartTest.php index 52040a503c37a..8ae61d5ea7928 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/ViewModel/CartTest.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/ViewModel/CartTest.php @@ -17,7 +17,6 @@ /** * Test for clear shopping cart config * - * @package Magento\Checkout\ViewModel * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class CartTest extends TestCase