Skip to content

Commit 6c1f4f3

Browse files
committed
Fixed static test failures
1 parent bc97c90 commit 6c1f4f3

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

app/code/Magento/Captcha/Block/CaptchaLayoutProcessor.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ public function __construct(
2828
*/
2929
public function process($jsLayout): array
3030
{
31-
if(!$this->helper->getConfig('enable')) {
31+
if (!$this->helper->getConfig('enable')) {
3232
if (isset($jsLayout['components']['checkout']['children']['authentication']['children']['captcha'])) {
3333
unset($jsLayout['components']['checkout']['children']['authentication']['children']['captcha']);
3434
}
35-
if (isset($jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['shippingAddress']['children']['customer-email']['children']['additional-login-form-fields']['children']['captcha'])) {
36-
unset($jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']['shippingAddress']['children']['customer-email']['children']['additional-login-form-fields']['children']['captcha']);
35+
if (isset($jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
36+
['shippingAddress']['children']['customer-email']['children']['additional-login-form-fields']
37+
['children']['captcha'])) {
38+
unset($jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
39+
['shippingAddress']['children']['customer-email']['children']['additional-login-form-fields']
40+
['children']['captcha']);
3741
}
3842
if (isset($jsLayout['components']['authenticationPopup']['children']['captcha'])) {
3943
unset($jsLayout['components']['authenticationPopup']['children']['captcha']);

app/code/Magento/Customer/Block/Account/AuthenticationPopup.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*/
66
namespace Magento\Customer\Block\Account;
77

8+
use Magento\Framework\App\ObjectManager;
89
use Magento\Customer\Model\Form;
910
use Magento\Store\Model\ScopeInterface;
1011
use Magento\Customer\Model\Context;
12+
use Magento\Framework\App\Http\Context as HttpContext;
1113

1214
/**
1315
* @api
@@ -25,21 +27,29 @@ class AuthenticationPopup extends \Magento\Framework\View\Element\Template
2527
*/
2628
private $serializer;
2729

30+
/**
31+
* @var HttpContext
32+
*/
33+
private $httpContext;
34+
2835
/**
2936
* @param \Magento\Framework\View\Element\Template\Context $context
3037
* @param array $data
3138
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
39+
* @param HttpContext $httpContext
3240
* @throws \RuntimeException
3341
*/
3442
public function __construct(
3543
\Magento\Framework\View\Element\Template\Context $context,
3644
array $data = [],
37-
?\Magento\Framework\Serialize\Serializer\Json $serializer = null
45+
?\Magento\Framework\Serialize\Serializer\Json $serializer = null,
46+
HttpContext $httpContext = null
3847
) {
3948
parent::__construct($context, $data);
4049
$this->jsLayout = isset($data['jsLayout']) && is_array($data['jsLayout']) ? $data['jsLayout'] : [];
4150
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
4251
->get(\Magento\Framework\Serialize\Serializer\Json::class);
52+
$this->httpContext = $httpContext ?: ObjectManager::getInstance()->get(HttpContext::class);
4353
}
4454

4555
/**
@@ -54,7 +64,7 @@ public function getJsLayout()
5464
Form::XML_PATH_CUSTOMER_CAPTCHA_ENABLED,
5565
ScopeInterface::SCOPE_STORE
5666
) && !$this->isLoggedIn()) {
57-
if(isset($this->jsLayout['components']['authenticationPopup']['children']['captcha'])) {
67+
if (isset($this->jsLayout['components']['authenticationPopup']['children']['captcha'])) {
5868
unset($this->jsLayout['components']['authenticationPopup']['children']['captcha']);
5969
}
6070
}

0 commit comments

Comments
 (0)