Skip to content

Commit 40a898e

Browse files
committed
Merge branch '2.2-tests-pr' into MC-8647
2 parents a706276 + e72c183 commit 40a898e

File tree

145 files changed

+2063
-1264
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+2063
-1264
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminDashboardPageIsVisibleActionGroup">
12+
<seeInCurrentUrl url="{{AdminDashboardPage.url}}" stepKey="seeDashboardUrl"/>
13+
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="ChangedCookieDomainForMainWebsiteConfigData">
12+
<data key="path">web/cookie/cookie_domain</data>
13+
<data key="scope">website</data>
14+
<data key="scope_code">base</data>
15+
<data key="value">testDomain.com</data>
16+
</entity>
17+
<entity name="EmptyCookieDomainForMainWebsiteConfigData">
18+
<data key="path">web/cookie/cookie_domain</data>
19+
<data key="scope">website</data>
20+
<data key="scope_code">base</data>
21+
<data key="value">''</data>
22+
</entity>
23+
</entities>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminLoginAfterChangeCookieDomainTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Login on the Admin Backend"/>
15+
<title value="Admin user can login after changing cookie domain on main website scope without changing cookie domain on default scope"/>
16+
<description value="Admin user can login after changing cookie domain on main website scope without changing cookie domain on default scope"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MC-17931"/>
19+
<useCaseId value="MC-17292"/>
20+
<group value="backend"/>
21+
</annotations>
22+
<before>
23+
<magentoCLI command="config:set {{ChangedCookieDomainForMainWebsiteConfigData.path}} --scope={{ChangedCookieDomainForMainWebsiteConfigData.scope}} --scope-code={{ChangedCookieDomainForMainWebsiteConfigData.scope_code}} {{ChangedCookieDomainForMainWebsiteConfigData.value}}" stepKey="changeDomainForMainWebsiteBeforeTestRun"/>
24+
<magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/>
25+
</before>
26+
<after>
27+
<magentoCLI command="config:set {{EmptyCookieDomainForMainWebsiteConfigData.path}} --scope={{EmptyCookieDomainForMainWebsiteConfigData.scope}} --scope-code={{EmptyCookieDomainForMainWebsiteConfigData.scope_code}} {{EmptyCookieDomainForMainWebsiteConfigData.value}}" stepKey="changeDomainForMainWebsiteAfterTestComplete"/>
28+
<magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestComplete"/>
29+
</after>
30+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
31+
<actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="seeDashboardPage"/>
32+
<actionGroup ref="logout" stepKey="logoutFromAdmin"/>
33+
</test>
34+
</tests>

app/code/Magento/Backend/etc/adminhtml/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
<arguments>
8787
<argument name="lifetimePath" xsi:type="const">Magento\Backend\Model\Auth\Session::XML_PATH_SESSION_LIFETIME</argument>
8888
<argument name="sessionName" xsi:type="const">Magento\Backend\Model\Session\AdminConfig::SESSION_NAME_ADMIN</argument>
89+
<argument name="scopeType" xsi:type="const">Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT</argument>
8990
</arguments>
9091
</type>
9192
<type name="Magento\Framework\View\Result\PageFactory">

app/code/Magento/Backend/view/adminhtml/templates/admin/access_denied.phtml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
96
?>
107
<?php
118
/**
129
* @see \Magento\Backend\Block\Denied
1310
*/
11+
12+
// phpcs:disable Magento2.Security.Superglobal
1413
?>
1514
<hr class="access-denied-hr"/>
1615
<div class="access-denied-page">
@@ -21,10 +20,10 @@
2120
<li><span><?= $block->escapeHtml(__('Contact a system administrator or store owner to gain permissions.')) ?></span></li>
2221
<li>
2322
<span><?= $block->escapeHtml(__('Return to ')) ?>
24-
<?php if(isset($_SERVER['HTTP_REFERER'])): ?>
23+
<?php if (isset($_SERVER['HTTP_REFERER'])) : ?>
2524
<a href="<?= $block->escapeUrl(__($_SERVER['HTTP_REFERER'])) ?>">
2625
<?= $block->escapeHtml(__('previous page')) ?></a><?= $block->escapeHtml(__('.')) ?>
27-
<?php else: ?>
26+
<?php else : ?>
2827
<a href="<?= $block->escapeHtmlAttr(__('javascript:history.back()')) ?>">
2928
<?= $block->escapeHtml(__('previous page')) ?></a><?= $block->escapeHtml(__('.')) ?>
3029
<?php endif ?>

app/code/Magento/Backend/view/adminhtml/templates/admin/formkey.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* See COPYING.txt for license details.
55
*/
66
?>
7-
<div><input name="form_key" type="hidden" value="<?= /* @escapeNotVerified */ $block->getFormKey() ?>" /></div>
7+
<div><input name="form_key" type="hidden" value="<?= $block->escapeHtmlAttr($block->getFormKey()) ?>" /></div>

app/code/Magento/Backend/view/adminhtml/templates/admin/login.phtml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
7+
/**
8+
* @var \Magento\Framework\View\Element\AbstractBlock $block
9+
*/
910
?>
1011

1112
<form method="post" action="" id="login-form" data-mage-init='{"form": {}, "validation": {}}' autocomplete="off">
1213
<fieldset class="admin__fieldset">
1314
<legend class="admin__legend">
14-
<span><?= /* @escapeNotVerified */ __('Welcome, please sign in') ?></span>
15+
<span><?= $block->escapeHtml(__('Welcome, please sign in')) ?></span>
1516
</legend><br/>
16-
<input name="form_key" type="hidden" value="<?= /* @escapeNotVerified */ $block->getFormKey() ?>" />
17+
<input name="form_key" type="hidden" value="<?= $block->escapeHtmlAttr($block->getFormKey()) ?>" />
1718
<div class="admin__field _required field-username">
1819
<label for="username" class="admin__field-label">
19-
<span><?= /* @escapeNotVerified */ __('Username') ?></span>
20+
<span><?= $block->escapeHtml(__('Username')) ?></span>
2021
</label>
2122
<div class="admin__field-control">
2223
<input id="username"
@@ -26,14 +27,14 @@
2627
autofocus
2728
value=""
2829
data-validate="{required:true}"
29-
placeholder="<?= /* @escapeNotVerified */ __('user name') ?>"
30+
placeholder="<?= $block->escapeHtmlAttr(__('user name')) ?>"
3031
autocomplete="off"
3132
/>
3233
</div>
3334
</div>
3435
<div class="admin__field _required field-password">
3536
<label for="login" class="admin__field-label">
36-
<span><?= /* @escapeNotVerified */ __('Password') ?></span>
37+
<span><?= $block->escapeHtml(__('Password')) ?></span>
3738
</label>
3839
<div class="admin__field-control">
3940
<input id="login"
@@ -42,7 +43,7 @@
4243
name="login[password]"
4344
data-validate="{required:true}"
4445
value=""
45-
placeholder="<?= /* @escapeNotVerified */ __('password') ?>"
46+
placeholder="<?= $block->escapeHtmlAttr(__('password')) ?>"
4647
autocomplete="off"
4748
/>
4849
</div>

app/code/Magento/Backend/view/adminhtml/templates/admin/login_buttons.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<button
99
<?php $block->getUiId(); ?>
1010
class="action-login action-primary">
11-
<span><?= /* @escapeNotVerified */ __('Sign in') ?></span>
11+
<span><?= $block->escapeHtml(__('Sign in')) ?></span>
1212
</button>
1313
</div>

app/code/Magento/Backend/view/adminhtml/templates/admin/overlay_popup.phtml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
96
?>
107
<div class="wrapper-popup">
118
<div class="middle" id="anchor-content">
129
<div id="page:main-container">
13-
<?php if ($block->getChildHtml('left')): ?>
14-
<div class="columns <?= /* @escapeNotVerified */ $block->getContainerCssClass() ?>" id="page:container">
10+
<?php if ($block->getChildHtml('left')) : ?>
11+
<div class="columns <?= $block->escapeHtmlAttr($block->getContainerCssClass()) ?>" id="page:container">
1512
<div id="page:left" class="side-col">
1613
<?= $block->getChildHtml('left') ?>
1714
</div>
@@ -24,13 +21,13 @@
2421
</div>
2522
</div>
2623
</div>
27-
<?php else: ?>
28-
<div id="messages" data-container-for="messages"><?= $block->getLayout()->getMessagesBlock()->getGroupedHtml() ?></div>
29-
<?= $block->getChildHtml('content') ?>
30-
<?php endif; ?>
24+
<?php else : ?>
25+
<div id="messages" data-container-for="messages"><?= $block->getLayout()->getMessagesBlock()->getGroupedHtml() ?></div>
26+
<?= $block->getChildHtml('content') ?>
27+
<?php endif; ?>
3128
</div>
3229
</div>
33-
<?php if ($block->getChildHtml('footer')): ?>
30+
<?php if ($block->getChildHtml('footer')) : ?>
3431
<div class="footer">
3532
<?= $block->getChildHtml('footer') ?>
3633
</div>

app/code/Magento/Backend/view/adminhtml/templates/admin/page.phtml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,16 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
96
?>
107
<?php /** @var $block \Magento\Backend\Block\Page */ ?>
118
<!doctype html>
12-
<html lang="<?= /* @escapeNotVerified */ $block->getLang() ?>" class="no-js">
9+
<html lang="<?= $block->escapeHtmlAttr($block->getLang()) ?>" class="no-js">
1310

1411
<head>
1512
<?= $block->getChildHtml('head') ?>
1613
</head>
1714

18-
<body id="html-body"<?= $block->getBodyClass() ? ' class="' . $block->getBodyClass() . '"' : '' ?> data-container="body" data-mage-init='{"loaderAjax":{},"loader":{}}'>
15+
<body id="html-body" class="<?= $block->escapeHtmlAttr($block->getBodyClass())?>" data-container="body" data-mage-init='{"loaderAjax":{},"loader":{}}'>
1916
<div class="page-wrapper">
2017
<?= $block->getChildHtml('notification_window') ?>
2118
<?= $block->getChildHtml('global_notices') ?>
@@ -31,8 +28,8 @@
3128
<?= $block->getLayout()->getMessagesBlock()->getGroupedHtml() ?>
3229
</div>
3330
<?= $block->getChildHtml('page_main_actions') ?>
34-
<?php if ($block->getChildHtml('left')): ?>
35-
<div id="page:main-container" class="<?= /* @escapeNotVerified */ $block->getContainerCssClass() ?> col-2-left-layout">
31+
<?php if ($block->getChildHtml('left')) : ?>
32+
<div id="page:main-container" class="<?= $block->escapeHtmlAttr($block->getContainerCssClass()) ?> col-2-left-layout">
3633
<div class="main-col" id="content">
3734
<?= $block->getChildHtml('content') ?>
3835
</div>
@@ -41,7 +38,7 @@
4138
<?= $block->getChildHtml('left') ?>
4239
</div>
4340
</div>
44-
<?php else: ?>
41+
<?php else : ?>
4542
<div id="page:main-container" class="col-1-layout">
4643
<?= $block->getChildHtml('content') ?>
4744
</div>

app/code/Magento/Backend/view/adminhtml/templates/dashboard/graph.phtml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
96
?>
107
<div class="dashboard-diagram">
118
<div class="dashboard-diagram-switcher">
129
<label for="order_<?= $block->getHtmlId() ?>_period"
13-
class="label"><?= /* @escapeNotVerified */ __('Select Range:') ?></label>
10+
class="label"><?= $block->escapeHtml(__('Select Range:')) ?></label>
1411
<select name="period" id="order_<?= $block->getHtmlId() ?>_period"
1512
onchange="changeDiagramsPeriod(this);" class="admin__control-select">
16-
<?php foreach ($this->helper('Magento\Backend\Helper\Dashboard\Data')->getDatePeriods() as $value => $label): ?>
17-
<?php if (in_array($value, ['custom'])) {
13+
<?php $datePeriods = $this->helper(\Magento\Backend\Helper\Dashboard\Data::class)->getDatePeriods();?>
14+
<?php foreach ($datePeriods as $value => $label) : ?>
15+
<?php
16+
if (in_array($value, ['custom'])) {
1817
continue;
19-
} ?>
20-
<option value="<?= /* @escapeNotVerified */ $value ?>"
21-
<?php if ($block->getRequest()->getParam('period') == $value): ?> selected="selected"<?php endif; ?>
22-
><?= /* @escapeNotVerified */ $label ?></option>
18+
}
19+
?>
20+
<option value="<?= /* @noEscape */ $value ?>"
21+
<?php if ($block->getRequest()->getParam('period') == $value) : ?> selected="selected"<?php endif; ?>
22+
><?= $block->escapeHtml($label) ?></option>
2323
<?php endforeach; ?>
2424
</select>
2525
</div>
26-
<?php if ($block->getCount()): ?>
26+
<?php if ($block->getCount()) : ?>
2727
<div class="dashboard-diagram-image">
28-
<img src="<?= /* @escapeNotVerified */ $block->getChartUrl(false) ?>" class="dashboard-diagram-chart" alt="Chart" title="Chart" />
28+
<img src="<?= $block->escapeUrl($block->getChartUrl(false)) ?>" class="dashboard-diagram-chart" alt="Chart" title="Chart" />
2929
</div>
30-
<?php else: ?>
30+
<?php else : ?>
3131
<div class="dashboard-diagram-nodata">
32-
<span><?= /* @escapeNotVerified */ __('No Data Found') ?></span>
32+
<span><?= $block->escapeHtml(__('No Data Found')) ?></span>
3333
</div>
3434
<?php endif; ?>
3535
</div>

app/code/Magento/Backend/view/adminhtml/templates/dashboard/graph/disabled.phtml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
86
?>
97
<div class="dashboard-diagram-disabled">
10-
<?= /* @escapeNotVerified */ __('Chart is disabled. To enable the chart, click <a href="%1">here</a>.', $block->getConfigUrl()) ?>
8+
<?= $block->escapeHtml(__('Chart is disabled. To enable the chart, click <a href="%1">here</a>.', $block->getConfigUrl()), ['a']) ?>
119
</div>

0 commit comments

Comments
 (0)