mirror of
https://github.com/bdnugget/magento2.git
synced 2026-11-07 09:17:35 +00:00
AC-2701:: Roll back and Fixed the static tests
This commit is contained in:
1 parent
f9adcd9e3a
commit
fd7e45e945
15 files changed
+418
-15
No files matched your search
@@ -130,6 +130,7 @@ class UpdateItemQty extends Action implements HttpPostActionInterface
|
||||
{
|
||||
if ($qty > 0) {
|
||||
$item->clearMessage();
|
||||
$item->setHasError(false);
|
||||
$item->setQty($qty);
|
||||
|
||||
if ($item->getHasError()) {
|
||||
|
||||
@@ -535,6 +535,8 @@ class Cart extends DataObject implements CartInterface
|
||||
|
||||
$qty = isset($itemInfo['qty']) ? (double)$itemInfo['qty'] : false;
|
||||
if ($qty > 0) {
|
||||
$item->clearMessage();
|
||||
$item->setHasError(false);
|
||||
$item->setQty($qty);
|
||||
|
||||
if ($item->getHasError()) {
|
||||
@@ -707,6 +709,9 @@ class Cart extends DataObject implements CartInterface
|
||||
*/
|
||||
public function updateItem($itemId, $requestInfo = null, $updatingParams = null)
|
||||
{
|
||||
$product = null;
|
||||
$productId = null;
|
||||
|
||||
try {
|
||||
$item = $this->getQuote()->getItemById($itemId);
|
||||
if (!$item) {
|
||||
@@ -757,6 +762,7 @@ class Cart extends DataObject implements CartInterface
|
||||
* Getter for RequestInfoFilter
|
||||
*
|
||||
* @deprecated 100.1.2
|
||||
* @see MAGETWO-60073
|
||||
* @return \Magento\Checkout\Model\Cart\RequestInfoFilterInterface
|
||||
*/
|
||||
private function getRequestInfoFilter()
|
||||
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
|
||||
<test name="StorefrontProductQuantityAcceptLowerThanStockQuantityAfterChangingStockInBackendTest">
|
||||
<annotations>
|
||||
<stories value="Cart"/>
|
||||
<title value="Verify if lower than stock product quantity is accepted after changing stock qty in backend"/>
|
||||
<description value="Verify if lower than stock product quantity is accepted after changing stock qty in backend"/>
|
||||
<severity value="CRITICAL"/>
|
||||
<testCaseId value="AC-5987"/>
|
||||
<group value="mtf_migrated"/>
|
||||
</annotations>
|
||||
|
||||
<before>
|
||||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
|
||||
<createData entity="defaultSimpleProduct" stepKey="simpleProduct">
|
||||
<field key="price">10.00</field>
|
||||
<field key="quantity">20</field>
|
||||
</createData>
|
||||
</before>
|
||||
<after>
|
||||
<deleteData createDataKey="simpleProduct" stepKey="deleteProduct"/>
|
||||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
|
||||
</after>
|
||||
|
||||
<!--Open Product page in StoreFront and assert product and price range -->
|
||||
<actionGroup ref="AssertProductNameAndSkuInStorefrontProductPageByCustomAttributeUrlKeyActionGroup" stepKey="openProductPage">
|
||||
<argument name="product" value="$$simpleProduct$$"/>
|
||||
</actionGroup>
|
||||
|
||||
<!--Add product to the cart -->
|
||||
<actionGroup ref="StorefrontAddProductToCartWithQtyActionGroup" stepKey="addProductToTheCart">
|
||||
<argument name="productQty" value="12"/>
|
||||
</actionGroup>
|
||||
|
||||
<!--Open View and edit -->
|
||||
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickMiniCart"/>
|
||||
|
||||
<waitForPageLoad stepKey="waitForOrderPageToLoad"/>
|
||||
|
||||
<!--Edit product qty via admin panel-->
|
||||
<openNewTab stepKey="openNewTab"/>
|
||||
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="goToProductEditPage">
|
||||
<argument name="productId" value="$$simpleProduct.id$$"/>
|
||||
</actionGroup>
|
||||
<fillField userInput="10" selector="{{AdminProductFormSection.productQuantity}}" stepKey="setNewQty"/>
|
||||
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
|
||||
<closeTab stepKey="closeTab"/>
|
||||
|
||||
<!--Check quantity-->
|
||||
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage"/>
|
||||
<comment userInput="Replacing reload action and preserve Backward Compatibility" stepKey="waitForCheckoutPageReload"/>
|
||||
|
||||
<waitForPageLoad stepKey="waitForPageLoad1"/>
|
||||
<waitForAjaxLoad stepKey="waitForAjaxLoad1"/>
|
||||
|
||||
<!--Assert "The requested qty is not available"-->
|
||||
<see selector="{{CheckoutCartMessageSection.errorMessage}}" userInput="The requested qty is not available" stepKey="seeTheErrorMessageDisplayed"/>
|
||||
|
||||
<fillField selector="{{CheckoutCartProductSection.qty($$simpleProduct.sku$$)}}" userInput="8" stepKey="updateProductQty"/>
|
||||
<click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="clickUpdateShoppingCart"/>
|
||||
<waitForAjaxLoad stepKey="waitForAjaxLoad2"/>
|
||||
<waitForAjaxLoad stepKey="waitForPageLoad2"/>
|
||||
|
||||
<dontSee userInput="The requested qty is not available" stepKey="dontSeeTheErrorMessageDisplayed"/>
|
||||
|
||||
</test>
|
||||
</tests>
|
||||
@@ -19,6 +19,7 @@ define(
|
||||
|
||||
return function (serviceUrl, payload, messageContainer) {
|
||||
var headers = {};
|
||||
var redirectURL = '';
|
||||
|
||||
fullScreenLoader.startLoader();
|
||||
_.each(hooks.requestModifiers, function (modifier) {
|
||||
@@ -30,6 +31,13 @@ define(
|
||||
).fail(
|
||||
function (response) {
|
||||
errorProcessor.process(response, messageContainer);
|
||||
redirectURL = response.getResponseHeader('errorRedirectAction');
|
||||
|
||||
if (redirectURL) {
|
||||
setTimeout(function () {
|
||||
errorProcessor.redirectTo(redirectURL);
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
).done(
|
||||
function (response) {
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Magento\Payment\Plugin;
|
||||
|
||||
use Magento\Framework\App\ObjectManager;
|
||||
use Magento\Payment\Block\Form\Container;
|
||||
use Magento\Vault\Model\Ui\Adminhtml\TokensConfigProvider;
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
class PaymentMethodProcess
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $braintreeCCVault;
|
||||
|
||||
/**
|
||||
* @var TokensConfigProvider
|
||||
*/
|
||||
private TokensConfigProvider $tokensConfigProvider;
|
||||
|
||||
/**
|
||||
* @param string $braintreeCCVault
|
||||
* @param TokensConfigProvider|null $tokensConfigProvider
|
||||
*/
|
||||
public function __construct(
|
||||
string $braintreeCCVault = '',
|
||||
TokensConfigProvider $tokensConfigProvider = null
|
||||
) {
|
||||
$this->braintreeCCVault = $braintreeCCVault;
|
||||
$this->tokensConfigProvider = $tokensConfigProvider ??
|
||||
ObjectManager::getInstance()->get(TokensConfigProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve available payment methods
|
||||
*
|
||||
* @param Container $container
|
||||
* @param array $results
|
||||
* @return array
|
||||
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
|
||||
*/
|
||||
public function afterGetMethods(Container $container, array $results): array
|
||||
{
|
||||
$methods = [];
|
||||
foreach ($results as $result) {
|
||||
if ($result->getCode() === $this->braintreeCCVault
|
||||
&& empty($this->tokensConfigProvider->getTokensComponents($result->getCode()))) {
|
||||
|
||||
continue;
|
||||
}
|
||||
$methods[] = $result;
|
||||
}
|
||||
return $methods;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Magento\Payment\Test\Unit\Plugin;
|
||||
|
||||
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
|
||||
use Magento\Payment\Api\Data\PaymentMethodInterface;
|
||||
use Magento\Payment\Block\Form\Container;
|
||||
use Magento\Payment\Plugin\PaymentMethodProcess;
|
||||
use Magento\Vault\Model\Ui\Adminhtml\TokensConfigProvider;
|
||||
use Magento\Vault\Model\Ui\TokenUiComponentInterface;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class PaymentMethodProcessTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @const string
|
||||
*/
|
||||
public const PAYMENT_METHOD_CHECKMO = 'checkmo';
|
||||
|
||||
/**
|
||||
* @const string
|
||||
*/
|
||||
public const PAYMENT_METHOD_BRAINTREE = 'braintree';
|
||||
|
||||
/**
|
||||
* @const string
|
||||
*/
|
||||
public const PAYMENT_METHOD_BRAINTREE_CC_VAULT = 'braintree_cc_vault';
|
||||
|
||||
/**
|
||||
* @var TokensConfigProvider|MockObject
|
||||
*/
|
||||
private TokensConfigProvider $tokensConfigProviderMock;
|
||||
|
||||
/**
|
||||
* @var Container|MockObject
|
||||
*/
|
||||
private $containerMock;
|
||||
|
||||
/**
|
||||
* @var PaymentMethodProcess
|
||||
*/
|
||||
private $plugin;
|
||||
|
||||
/**
|
||||
* Set up
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->tokensConfigProviderMock = $this->getMockBuilder(TokensConfigProvider::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$objectManagerHelper = new ObjectManager($this);
|
||||
$this->containerMock = $objectManagerHelper->getObject(Container::class);
|
||||
|
||||
$this->plugin = $objectManagerHelper->getObject(
|
||||
PaymentMethodProcess::class,
|
||||
[
|
||||
'braintreeCCVault' => self::PAYMENT_METHOD_BRAINTREE_CC_VAULT,
|
||||
'tokensConfigProvider' => $this->tokensConfigProviderMock
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $methods
|
||||
* @param array $expectedResult
|
||||
* @param array $tokenComponents
|
||||
* @dataProvider afterGetMethodsDataProvider
|
||||
*/
|
||||
public function testAfterGetMethods(array $methods, array $expectedResult, array $tokenComponents)
|
||||
{
|
||||
|
||||
$this->tokensConfigProviderMock->method('getTokensComponents')
|
||||
->with(self::PAYMENT_METHOD_BRAINTREE_CC_VAULT)
|
||||
->willReturn($tokenComponents);
|
||||
|
||||
$result = $this->plugin->afterGetMethods($this->containerMock, $methods);
|
||||
$this->assertEquals($result, $expectedResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for AfterGetMethods.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function afterGetMethodsDataProvider(): array
|
||||
{
|
||||
$tokenUiComponentInterface = $this->getMockBuilder(TokenUiComponentInterface::class)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$checkmoPaymentMethod = $this
|
||||
->getMockBuilder(PaymentMethodInterface::class)
|
||||
->disableOriginalConstructor()
|
||||
->setMethods(['getCode'])
|
||||
->getMockForAbstractClass();
|
||||
$brainTreePaymentMethod = $this
|
||||
->getMockBuilder(PaymentMethodInterface::class)
|
||||
->disableOriginalConstructor()
|
||||
->setMethods(['getCode'])
|
||||
->getMockForAbstractClass();
|
||||
$brainTreeCCVaultTPaymentMethod = $this
|
||||
->getMockBuilder(PaymentMethodInterface::class)
|
||||
->disableOriginalConstructor()
|
||||
->setMethods(['getCode'])
|
||||
->getMockForAbstractClass();
|
||||
|
||||
$checkmoPaymentMethod->expects($this->any())->method('getCode')
|
||||
->willReturn(self::PAYMENT_METHOD_CHECKMO);
|
||||
$brainTreePaymentMethod->expects($this->any())->method('getCode')
|
||||
->willReturn(self::PAYMENT_METHOD_BRAINTREE);
|
||||
$brainTreeCCVaultTPaymentMethod->expects($this->any())->method('getCode')
|
||||
->willReturn(self::PAYMENT_METHOD_BRAINTREE_CC_VAULT);
|
||||
|
||||
$paymentMethods = [
|
||||
$checkmoPaymentMethod,
|
||||
$brainTreePaymentMethod,
|
||||
$brainTreeCCVaultTPaymentMethod,
|
||||
];
|
||||
$expectedResult1 = [
|
||||
$checkmoPaymentMethod,
|
||||
$brainTreePaymentMethod,
|
||||
$brainTreeCCVaultTPaymentMethod
|
||||
];
|
||||
$expectedResult2 = [
|
||||
$checkmoPaymentMethod,
|
||||
$brainTreePaymentMethod,
|
||||
];
|
||||
|
||||
return [
|
||||
[$paymentMethods, $expectedResult1, [$tokenUiComponentInterface]],
|
||||
[$paymentMethods, $expectedResult2, []],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,8 @@
|
||||
"magento/module-quote": "*",
|
||||
"magento/module-sales": "*",
|
||||
"magento/module-store": "*",
|
||||
"magento/module-ui": "*"
|
||||
"magento/module-ui": "*",
|
||||
"magento/module-vault": "*"
|
||||
},
|
||||
"type": "magento2-module",
|
||||
"license": [
|
||||
|
||||
@@ -81,4 +81,12 @@
|
||||
<argument name="logger" xsi:type="object">Magento\Payment\Model\Method\VirtualLogger</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<type name="Magento\Payment\Block\Form\Container">
|
||||
<plugin name="PaymentMethodProcess" type="Magento\Payment\Plugin\PaymentMethodProcess"/>
|
||||
</type>
|
||||
<type name="Magento\Payment\Plugin\PaymentMethodProcess">
|
||||
<arguments>
|
||||
<argument name="braintreeCCVault" xsi:type="string">braintree_cc_vault</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
</config>
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
-->
|
||||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
|
||||
<test name="AdminFreeShippingNotAvailableIfDiscountCouponReducesOrderTotalBelowThresholdTest">
|
||||
<annotations>
|
||||
<features value="Sales"/>
|
||||
<stories value="Admin create order"/>
|
||||
<title value="Free Shipping is not available in Admin if order total is less than Minimum order-amount eligible for free shipping"/>
|
||||
<description value="Admin should not be able see Free Shipping method if order total is less than Minimum order-amount eligible for free shipping"/>
|
||||
<severity value="AVERAGE"/>
|
||||
<testCaseId value="AC-937"/>
|
||||
<group value="sales"/>
|
||||
</annotations>
|
||||
<before>
|
||||
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
|
||||
<createData entity="SimpleProduct" stepKey="createProduct">
|
||||
<requiredEntity createDataKey="createCategory"/>
|
||||
<field key="price">102</field>
|
||||
</createData>
|
||||
|
||||
<createData entity="ActiveSalesRuleCoupon50" stepKey="createCartPriceRule"/>
|
||||
<createData entity="SimpleSalesRuleCoupon" stepKey="createCouponForCartPriceRule">
|
||||
<requiredEntity createDataKey="createCartPriceRule"/>
|
||||
</createData>
|
||||
|
||||
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
|
||||
<createData entity="DisableFlatRateShippingMethodConfig" stepKey="disableFlatRate"/>
|
||||
<createData entity="FreeShippinMethodConfig" stepKey="enableFreeShippingMethod"/>
|
||||
<createData entity="setFreeShippingSubtotal" stepKey="setFreeShippingSubtotal"/>
|
||||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
|
||||
<comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/>
|
||||
</before>
|
||||
<after>
|
||||
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
|
||||
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
|
||||
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
|
||||
<deleteData createDataKey="createCartPriceRule" stepKey="deleteCartPriceRule"/>
|
||||
<createData entity="FlatRateShippingMethodConfig" stepKey="enableFlatRate"/>
|
||||
<createData entity="FreeShippinMethodDefault" stepKey="disableFreeShippingMethod"/>
|
||||
<createData entity="setFreeShippingSubtotalToDefault" stepKey="setFreeShippingSubtotalToDefault"/>
|
||||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
|
||||
<comment userInput="Adding the comment to replace CliCacheFlushActionGroup action group ('cache:flush' command) for preserving Backward Compatibility" stepKey="flushCache"/>
|
||||
</after>
|
||||
<!--Create new order with existing customer-->
|
||||
<actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="goToCreateOrderPage">
|
||||
<argument name="customer" value="$$createCustomer$$"/>
|
||||
</actionGroup>
|
||||
<!--Add product to order-->
|
||||
<actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder">
|
||||
<argument name="product" value="$$createProduct$$"/>
|
||||
</actionGroup>
|
||||
<click selector="{{AdminOrderFormPaymentSection.header}}" stepKey="focusout"/>
|
||||
<waitForPageLoad stepKey="waitForJavascriptToFinish"/>
|
||||
|
||||
<actionGroup ref="AdminApplyCouponToOrderActionGroup" stepKey="applyCoupon">
|
||||
<argument name="couponCode" value="$$createCouponForCartPriceRule.code$$"/>
|
||||
</actionGroup>
|
||||
<!--Click *Get shipping methods and rates* and see that Free Shipping is absent-->
|
||||
<click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickGetShippingMethods1"/>
|
||||
<dontSeeElement selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="seeFreeShippingAbsent"/>
|
||||
|
||||
<scrollToTopOfPage stepKey="scrollToTopOfPages"/>
|
||||
|
||||
<actionGroup ref="AdminRemoveCouponFromOrderActionGroup" stepKey="removeCoupon"/>
|
||||
<!--Click *Get shipping methods and rates* and see that Free Shipping is present-->
|
||||
<click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickGetShippingMethods2"/>
|
||||
<seeElement selector="{{AdminOrderFormPaymentSection.freeShippingOption}}" stepKey="seeFreeShippingPresent"/>
|
||||
</test>
|
||||
</tests>
|
||||
@@ -585,7 +585,7 @@ define([
|
||||
applyCoupon: function (code) {
|
||||
this.loadArea(['items', 'shipping_method', 'totals', 'billing_method'], true, {
|
||||
'order[coupon][code]': code,
|
||||
reset_shipping: 0
|
||||
reset_shipping: true
|
||||
});
|
||||
this.orderItemChanged = false;
|
||||
jQuery('html, body').animate({
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
namespace Magento\Webapi\Controller;
|
||||
|
||||
use Magento\Framework\Exception\AuthorizationException;
|
||||
use Magento\Framework\Exception\CouldNotSaveException;
|
||||
use Magento\Framework\Webapi\Authorization;
|
||||
use Magento\Framework\Webapi\ErrorProcessor;
|
||||
use Magento\Framework\Webapi\Rest\Request as RestRequest;
|
||||
@@ -16,9 +17,9 @@ use Magento\Framework\Webapi\ServiceInputProcessor;
|
||||
use Magento\Store\Model\Store;
|
||||
use Magento\Store\Model\StoreManagerInterface;
|
||||
use Magento\Webapi\Controller\Rest\ParamsOverrider;
|
||||
use Magento\Webapi\Controller\Rest\RequestProcessorPool;
|
||||
use Magento\Webapi\Controller\Rest\Router;
|
||||
use Magento\Webapi\Controller\Rest\Router\Route;
|
||||
use Magento\Webapi\Controller\Rest\RequestProcessorPool;
|
||||
|
||||
/**
|
||||
* Front controller for WebAPI REST area.
|
||||
@@ -38,12 +39,14 @@ class Rest implements \Magento\Framework\App\FrontControllerInterface
|
||||
/**
|
||||
* @var Router
|
||||
* @deprecated 100.1.0
|
||||
* @see MAGETWO-71174
|
||||
*/
|
||||
protected $_router;
|
||||
|
||||
/**
|
||||
* @var Route
|
||||
* @deprecated 100.1.0
|
||||
* @see MAGETWO-71174
|
||||
*/
|
||||
protected $_route;
|
||||
|
||||
@@ -70,12 +73,14 @@ class Rest implements \Magento\Framework\App\FrontControllerInterface
|
||||
/**
|
||||
* @var Authorization
|
||||
* @deprecated 100.1.0
|
||||
* @see MAGETWO-71174
|
||||
*/
|
||||
protected $authorization;
|
||||
|
||||
/**
|
||||
* @var ServiceInputProcessor
|
||||
* @deprecated 100.1.0
|
||||
* @see MAGETWO-71174
|
||||
*/
|
||||
protected $serviceInputProcessor;
|
||||
|
||||
@@ -102,6 +107,7 @@ class Rest implements \Magento\Framework\App\FrontControllerInterface
|
||||
/**
|
||||
* @var ParamsOverrider
|
||||
* @deprecated 100.1.0
|
||||
* @see MAGETWO-71174
|
||||
*/
|
||||
protected $paramsOverrider;
|
||||
|
||||
@@ -118,6 +124,7 @@ class Rest implements \Magento\Framework\App\FrontControllerInterface
|
||||
/**
|
||||
* @var StoreManagerInterface
|
||||
* @deprecated 100.1.0
|
||||
* @see MAGETWO-71174
|
||||
*/
|
||||
private $storeManager;
|
||||
|
||||
@@ -193,6 +200,10 @@ class Rest implements \Magento\Framework\App\FrontControllerInterface
|
||||
$this->requestValidator->validate($this->_request);
|
||||
$processor = $this->requestProcessorPool->getProcessor($this->_request);
|
||||
$processor->process($this->_request);
|
||||
} catch (CouldNotSaveException $e) {
|
||||
$maskedException = $this->_errorProcessor->maskException($e);
|
||||
$this->_response->setException($maskedException);
|
||||
$this->_response->setHeader('errorRedirectAction', '#shipping');
|
||||
} catch (\Exception $e) {
|
||||
$maskedException = $this->_errorProcessor->maskException($e);
|
||||
$this->_response->setException($maskedException);
|
||||
@@ -264,7 +275,8 @@ class Rest implements \Magento\Framework\App\FrontControllerInterface
|
||||
if ($this->storeManager->getStore()->getCode() === Store::ADMIN_CODE
|
||||
&& strtoupper($this->_request->getMethod()) === RestRequest::HTTP_METHOD_GET
|
||||
) {
|
||||
throw new \Magento\Framework\Webapi\Exception(__('Cannot perform GET operation with store code \'all\''));
|
||||
throw
|
||||
new \Magento\Framework\Webapi\Exception(__('Cannot perform GET operation with store code \'all\''));
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -1945,9 +1945,11 @@
|
||||
</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
|
||||
|
||||
<type name="Magento\Framework\Webapi\Validator\EntityArrayValidator">
|
||||
<arguments>
|
||||
<argument name="complexArrayItemLimit" xsi:type="number">20</argument>
|
||||
<argument name="complexArrayItemLimit" xsi:type="number">999999</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<type name="Magento\Framework\Webapi\Validator\SearchCriteriaValidator">
|
||||
@@ -1970,7 +1972,7 @@
|
||||
</type>
|
||||
<type name="Magento\Framework\Webapi\ServiceInputProcessor">
|
||||
<arguments>
|
||||
<argument name="defaultPageSize" xsi:type="number">20</argument>
|
||||
<argument name="defaultPageSize" xsi:type="number">999999</argument>
|
||||
</arguments>
|
||||
</type>
|
||||
<preference for="Magento\Framework\Filter\Input\PurifierInterface" type="Magento\Framework\Filter\Input\Purifier"/>
|
||||
|
||||
@@ -23,6 +23,13 @@ try {
|
||||
$application->run();
|
||||
} catch (\Throwable $e) {
|
||||
while ($e) {
|
||||
if ($e->getFile()) {
|
||||
echo sprintf("\nThere is an error in %s", $e->getFile());
|
||||
if ($e->getLine()) {
|
||||
echo sprintf(" at line: %d", $e->getLine());
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
echo $e->getMessage();
|
||||
echo $e->getTraceAsString();
|
||||
echo "\n\n";
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Copyright © Magento, Inc. All rights reserved.
|
||||
# See COPYING.txt for license details.
|
||||
|
||||
type Query {
|
||||
products(
|
||||
search: String,
|
||||
@@ -85,9 +88,7 @@ type ProductTierPrices {
|
||||
website_id: Float
|
||||
}
|
||||
|
||||
interface ProductInterface
|
||||
@typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite")
|
||||
@doc(description: "comment for ProductInterface")
|
||||
interface ProductInterface @typeResolver(class:"Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite") @doc(description: "comment for ProductInterface")
|
||||
{
|
||||
id: Int @doc(description: "comment for [ProductInterface].")
|
||||
name: String
|
||||
@@ -210,8 +211,11 @@ type CustomizableRadioValue {
|
||||
type VirtualProduct implements ProductInterface, CustomizableProductInterface {
|
||||
}
|
||||
|
||||
type SimpleProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface
|
||||
@doc(description: "Comment for empty SimpleProduct type")
|
||||
type SimpleProduct implements ProductInterface, PhysicalProductInterface, CustomizableProductInterface @doc(description: "Comment for empty SimpleProduct type")
|
||||
{
|
||||
}
|
||||
|
||||
type SimpleProduct implements ProductInterface & PhysicalProductInterface & CustomizableProductInterface @doc(description: "Comment for empty SimpleProduct type")
|
||||
{
|
||||
}
|
||||
|
||||
@@ -315,8 +319,7 @@ input ProductSortInput @doc(description:"Input ProductSortInput") {
|
||||
gift_message_available: SortEnum
|
||||
}
|
||||
|
||||
type MediaGalleryEntry
|
||||
@doc(description: "Comment for MediaGalleryEntry type")
|
||||
type MediaGalleryEntry @doc(description: "Comment for MediaGalleryEntry type")
|
||||
{
|
||||
id: Int @doc(description: "id for MediaGalleryEntry")
|
||||
media_type: String
|
||||
|
||||
@@ -12,8 +12,8 @@ use GraphQL\Utils\BuildSchema;
|
||||
use Magento\Framework\Config\FileResolverInterface;
|
||||
use Magento\Framework\Config\ReaderInterface;
|
||||
use Magento\Framework\GraphQl\Type\TypeManagement;
|
||||
use Magento\Framework\GraphQlSchemaStitching\GraphQlReader\TypeMetaReaderInterface as TypeReaderComposite;
|
||||
use Magento\Framework\GraphQlSchemaStitching\GraphQlReader\Reader\InterfaceType;
|
||||
use Magento\Framework\GraphQlSchemaStitching\GraphQlReader\TypeMetaReaderInterface as TypeReaderComposite;
|
||||
|
||||
/**
|
||||
* Reads *.graphqls files from modules and combines the results as array to be used with a library to configure objects
|
||||
@@ -331,7 +331,8 @@ class GraphQlReader implements ReaderInterface
|
||||
$spacePatternNotMandatory = '[\s\t\n\r]*';
|
||||
preg_match_all(
|
||||
"/{$spacePattern}{$implementsKindsPattern}{$spacePattern}{$typeNamePattern}"
|
||||
. "(,{$spacePatternNotMandatory}$typeNamePattern)*/im",
|
||||
. "(,{$spacePatternNotMandatory}|({$spacePatternNotMandatory}&{$spacePatternNotMandatory})?"
|
||||
. "$typeNamePattern)*/im",
|
||||
$graphQlSchemaContent,
|
||||
$allMatchesForImplements
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user