Skip to content

Commit b5d85e1

Browse files
committed
MAGETWO-99667: Fix Unrelated Static Test Failures
1 parent efbae63 commit b5d85e1

File tree

36 files changed

+368
-325
lines changed

36 files changed

+368
-325
lines changed

app/code/Magento/Tax/view/adminhtml/templates/items/price/row.phtml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,29 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
// phpcs:disable Magento2.Templates.ThisInTemplate
68
?>
79
<?php
810
/** @var \Magento\Tax\Block\Adminhtml\Items\Price\Renderer $block */
911

1012
$_item = $block->getItem();
1113
?>
12-
13-
<?php if ($block->displayBothPrices() || $block->displayPriceExclTax()): ?>
14+
<?php if ($block->displayBothPrices() || $block->displayPriceExclTax()) : ?>
1415
<div class="price-excl-tax">
15-
<?php if ($block->displayBothPrices()): ?>
16+
<?php if ($block->displayBothPrices()) : ?>
1617
<span class="label"><?= $block->escapeHtml(__('Excl. Tax')) ?>:</span>
1718
<?php endif; ?>
1819
<?= /* @noEscape */ $block->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
1920
</div>
2021
<?php endif; ?>
21-
<?php if ($block->displayBothPrices() || $block->displayPriceInclTax()): ?>
22+
<?php if ($block->displayBothPrices() || $block->displayPriceInclTax()) : ?>
2223
<div class="price-incl-tax">
23-
<?php if ($block->displayBothPrices()): ?>
24+
<?php if ($block->displayBothPrices()) : ?>
2425
<span class="label"><?= $block->escapeHtml(('Incl. Tax')) ?>:</span>
2526
<?php endif; ?>
26-
<?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?>
27-
<?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBaseSubtotalInclTax($_item); ?>
27+
<?php $_incl = $this->helper(\Magento\Checkout\Helper\Data::class)->getSubtotalInclTax($_item); ?>
28+
<?php $_baseIncl = $this->helper(\Magento\Checkout\Helper\Data::class)->getBaseSubtotalInclTax($_item); ?>
2829
<?= /* @noEscape */ $block->displayPrices($_baseIncl, $_incl) ?>
2930
</div>
3031
<?php endif; ?>

app/code/Magento/Tax/view/adminhtml/templates/items/price/unit.phtml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,31 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
// phpcs:disable Magento2.Templates.ThisInTemplate
68
?>
79
<?php
810
/** @var \Magento\Tax\Block\Adminhtml\Items\Price\Renderer $block */
911

1012
$_item = $block->getItem();
1113
?>
1214

13-
<?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?>
15+
<?php if ($this->helper(\Magento\Tax\Helper\Data::class)->displaySalesBothPrices() || $this->helper(\Magento\Tax\Helper\Data::class)->displaySalesPriceExclTax()) : ?>
1416
<div class="price-excl-tax">
15-
<?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?>
17+
<?php if ($this->helper(\Magento\Tax\Helper\Data::class)->displaySalesBothPrices()) : ?>
1618
<span class="label"><?= $block->escapeHtml(__('Excl. Tax')) ?>:</span>
1719
<?php endif; ?>
1820

1921
<?= /* @noEscape */ $block->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
2022
</div>
2123
<?php endif; ?>
22-
<?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?>
24+
<?php if ($this->helper(\Magento\Tax\Helper\Data::class)->displaySalesBothPrices() || $this->helper(\Magento\Tax\Helper\Data::class)->displaySalesPriceInclTax()) : ?>
2325
<div class="price-incl-tax">
24-
<?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?>
26+
<?php if ($this->helper(\Magento\Tax\Helper\Data::class)->displaySalesBothPrices()) : ?>
2527
<span class="label"><?= $block->escapeHtml(__('Incl. Tax')) ?>:</span>
2628
<?php endif; ?>
27-
<?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?>
28-
<?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBasePriceInclTax($_item); ?>
29+
<?php $_incl = $this->helper(\Magento\Checkout\Helper\Data::class)->getPriceInclTax($_item); ?>
30+
<?php $_baseIncl = $this->helper(\Magento\Checkout\Helper\Data::class)->getBasePriceInclTax($_item); ?>
2931

3032
<?= /* @noEscape */ $block->displayPrices($_baseIncl, $_incl) ?>
3133

app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/row.phtml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,26 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
// phpcs:disable Magento2.Templates.ThisInTemplate
68
?>
79
<?php
810
/** @var \Magento\Tax\Block\Adminhtml\Items\Price\Renderer $block */
911

1012
$_item = $block->getItem();
1113
?>
1214

13-
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()): ?>
14-
<?php if ($block->displayBothPrices($block->getStore())): ?>
15+
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()) : ?>
16+
<?php if ($block->displayBothPrices($block->getStore())) : ?>
1517
<span class="label"><?= $block->escapeHtml(__('Excl. Tax')) ?>:</span>
1618
<?php endif; ?>
1719
<?= /* @noEscape */ $block->formatPrice($_item->getRowTotal()) ?>
1820
<?php endif; ?>
1921

20-
<?php if ($block->displayPriceInclTax() || $block->displayBothPrices()): ?>
21-
<?php if ($block->displayBothPrices()): ?>
22+
<?php if ($block->displayPriceInclTax() || $block->displayBothPrices()) : ?>
23+
<?php if ($block->displayBothPrices()) : ?>
2224
<br /><span class="label"><?= $block->escapeHtml(__('Incl. Tax')) ?>:</span>
2325
<?php endif; ?>
24-
<?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?>
26+
<?php $_incl = $this->helper(\Magento\Checkout\Helper\Data::class)->getSubtotalInclTax($_item); ?>
2527
<?= /* @noEscape */ $block->formatPrice($_incl) ?>
2628
<?php endif; ?>

app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/total.phtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
$_item = $block->getItem();
1111
?>
1212

13-
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()): ?>
13+
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()) : ?>
1414
<?php $_rowTotalWithoutDiscount = $_item->getRowTotal() - $_item->getTotalDiscountAmount(); ?>
15-
<?php if ($block->displayBothPrices()): ?>
15+
<?php if ($block->displayBothPrices()) : ?>
1616
<span class="label"><?= $block->escapeHtml(__('Excl. Tax')) ?>:</span>
1717
<?php endif; ?>
1818
<?= /* @noEscape */ $block->formatPrice(max(0, $_rowTotalWithoutDiscount)) ?>
1919
<?php endif; ?>
2020

2121

22-
<?php if ($block->displayPriceInclTax() || $block->displayBothPrices()): ?>
23-
<?php if ($block->displayBothPrices($block->getStore())): ?>
22+
<?php if ($block->displayPriceInclTax() || $block->displayBothPrices()) : ?>
23+
<?php if ($block->displayBothPrices($block->getStore())) : ?>
2424
<br /><span class="label"><?= $block->escapeHtml(__('Incl. Tax')) ?>:</span>
2525
<?php endif; ?>
2626
<?php $_incl = $block->getTotalAmount($_item); ?>

app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/unit.phtml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,27 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
// phpcs:disable Magento2.Templates.ThisInTemplate
68
?>
79
<?php
810
/** @var \Magento\Tax\Block\Adminhtml\Items\Price\Renderer $block */
911

1012
$_item = $block->getItem();
1113
?>
1214

13-
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()): ?>
14-
<?php if ($block->displayBothPrices()): ?>
15+
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()) : ?>
16+
<?php if ($block->displayBothPrices()) : ?>
1517
<span class="label"><?= $block->escapeHtml(__('Excl. Tax')) ?>:</span>
1618
<?php endif; ?>
1719
<?= /* @noEscape */ $block->formatPrice($_item->getCalculationPrice()) ?>
1820
<?php endif; ?>
1921

2022

21-
<?php if ($block->displayPriceInclTax() || $block->displayBothPrices()): ?>
22-
<?php if ($block->displayBothPrices()): ?>
23+
<?php if ($block->displayPriceInclTax() || $block->displayBothPrices()) : ?>
24+
<?php if ($block->displayBothPrices()) : ?>
2325
<br /><span class="label"><?= $block->escapeHtml(__('Incl. Tax')) ?>:</span>
2426
<?php endif; ?>
25-
<?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?>
27+
<?php $_incl = $this->helper(\Magento\Checkout\Helper\Data::class)->getPriceInclTax($_item); ?>
2628
<?= /* @noEscape */ $block->formatPrice($_incl) ?>
2729
<?php endif; ?>

app/code/Magento/Tax/view/adminhtml/templates/rate/js.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
// phpcs:disable Magento2.Templates.ThisInTemplate
68
?>
79
<script>
810
require([
911
"jquery",
1012
"mage/adminhtml/form"
1113
], function(jQuery){
1214

13-
var updater = new RegionUpdater('tax_country_id', 'tax_region', 'tax_region_id', <?= /* @noEscape */ $this->helper('Magento\Directory\Helper\Data')->getRegionJson() ?>, 'disable');
15+
var updater = new RegionUpdater('tax_country_id', 'tax_region', 'tax_region_id', <?= /* @noEscape */ $this->helper(\Magento\Directory\Helper\Data::class)->getRegionJson() ?>, 'disable');
1416
updater.disableRegionValidation();
1517

1618
(function ($) {

app/code/Magento/Tax/view/adminhtml/templates/rate/title.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
?>
77
<fieldset id="tax-rate-titles-table" class="admin__fieldset">
88
<?php $_labels = $block->getTitles() ?>
9-
<?php foreach ($block->getStores() as $_store): ?>
9+
<?php foreach ($block->getStores() as $_store) : ?>
1010
<div class="admin__field">
1111
<label class="admin__field-label">
1212
<span><?= $block->escapeHtml($_store->getName()) ?></span>
1313
</label>
1414
<div class="admin__field-control">
1515
<input
16-
class="admin__control-text<?php if ($_store->getId() == 0): ?> required-entry<?php endif; ?>"
16+
class="admin__control-text<?php if ($_store->getId() == 0) : ?> required-entry<?php endif; ?>"
1717
type="text"
1818
name="title[<?= (int)$_store->getId() ?>]"
1919
value="<?= $block->escapeHtmlAttr($_labels[$_store->getId()]) ?>" />

app/code/Magento/Tax/view/adminhtml/templates/rule/edit.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ require([
113113
toggleAddButton:false,
114114
addText: '<?= $block->escapeJs($block->escapeHtml(__('Add New Tax Rate'))) ?>',
115115
parse: null,
116-
nextPageUrl: '<?php echo $block->escapeHtml($block->getTaxRatesPageUrl())?>',
116+
nextPageUrl: '<?= $block->escapeHtml($block->getTaxRatesPageUrl())?>',
117117
selectedValues: this.settings.selected_values,
118118
mselectInputSubmitCallback: function (value, options) {
119119
var select = $('#tax_rate');

app/code/Magento/Tax/view/adminhtml/templates/toolbar/rate/save.phtml

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,43 @@
44
* See COPYING.txt for license details.
55
*/
66
?>
7-
<?php if ($form): ?>
8-
<?= $form->toHtml() ?>
7+
<?php if ($form) : ?>
8+
<?= $form->toHtml() ?>
9+
<script>
10+
require([
11+
"jquery",
12+
"mage/mage"
13+
], function($){
914

10-
<script>
11-
require([
12-
"jquery",
13-
"mage/mage"
14-
], function($){
15+
$('#<?= $block->escapeHtml($form->getForm()->getId()) ?>').mage('form').mage('validation');
1516

16-
$('#<?= $block->escapeHtml($form->getForm()->getId()) ?>').mage('form').mage('validation');
17+
$(document).ready(function () {
18+
'use strict';
1719

18-
$(document).ready(function () {
19-
'use strict';
20+
$('.field-zip_from').addClass('ignore-validate');
21+
$('.field-zip_to').addClass('ignore-validate');
2022

21-
$('.field-zip_from').addClass('ignore-validate');
22-
$('.field-zip_to').addClass('ignore-validate');
23+
$('#zip_is_range').on('change.zipRange', function(){
2324

24-
$('#zip_is_range').on('change.zipRange', function(){
25+
var elem = $(this),
26+
zipFrom =$('.field-zip_from'),
27+
zipTo =$('.field-zip_to'),
28+
zipCode =$('.field-tax_postcode');
2529

26-
var elem = $(this),
27-
zipFrom =$('.field-zip_from'),
28-
zipTo =$('.field-zip_to'),
29-
zipCode =$('.field-tax_postcode');
30+
if (elem.is(':checked')) {
31+
zipCode.addClass('hidden').addClass('ignore-validate');
32+
zipFrom.removeClass('hidden').removeClass('ignore-validate');
33+
zipTo.removeClass('hidden').removeClass('ignore-validate');
3034

31-
if (elem.is(':checked')) {
32-
zipCode.addClass('hidden').addClass('ignore-validate');
33-
zipFrom.removeClass('hidden').removeClass('ignore-validate');
34-
zipTo.removeClass('hidden').removeClass('ignore-validate');
35-
36-
} else {
37-
zipCode.removeClass('hidden').removeClass('ignore-validate');
38-
zipFrom.addClass('hidden').addClass('ignore-validate');
39-
zipTo.addClass('hidden').addClass('ignore-validate');
40-
}
35+
} else {
36+
zipCode.removeClass('hidden').removeClass('ignore-validate');
37+
zipFrom.addClass('hidden').addClass('ignore-validate');
38+
zipTo.addClass('hidden').addClass('ignore-validate');
39+
}
4140

41+
});
4242
});
43-
});
4443

45-
});
46-
</script>
44+
});
45+
</script>
4746
<?php endif; ?>

app/code/Magento/Tax/view/base/templates/pricing/adjustment.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<?php /** @var \Magento\Tax\Pricing\Render\Adjustment $block */ ?>
99

10-
<?php if ($block->displayBothPrices()): ?>
10+
<?php if ($block->displayBothPrices()) : ?>
1111
<span id="<?= /* @noEscape */ $block->buildIdWithPrefix('price-excluding-tax-') ?>"
1212
data-label="<?= $block->escapeHtmlAttr(__('Excl. Tax')) ?>"
1313
data-price-amount="<?= /* @noEscape */ $block->getRawAmount() ?>"

0 commit comments

Comments
 (0)