Skip to content

Commit 37982f6

Browse files
author
Oleksandr Gorkun
committed
MC-33823: Merge CE, EE and B2B changes
1 parent 212c208 commit 37982f6

File tree

10 files changed

+45
-51
lines changed

10 files changed

+45
-51
lines changed

app/code/Magento/GiftMessage/view/frontend/templates/inline.phtml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,11 +448,10 @@ script;
448448
</dt>
449449
</dl>
450450
</fieldset>
451+
<?php $entityId = (int) $block->getEntity()->getId(); ?>
451452
<script type="text/x-magento-init">
452453
{
453-
"#allow_gift_options_<?= (int) $block->getEntity()->getId() ?>,
454-
#allow_gift_options_for_order_<?= (int) $block->getEntity()->getId() ?>,
455-
#allow_gift_options_for_items_<?= (int) $block->getEntity()->getId() ?>": {
454+
"#allow_gift_options_<?= /* @noEscape */ $entityId ?>, #allow_gift_options_for_order_<?= /* @noEscape */ $entityId ?>, #allow_gift_options_for_items_<?= /* @noEscape */ $entityId ?>": {
456455
"giftOptions": {}
457456
}
458457
}

app/code/Magento/SalesRule/Test/Mftf/Section/AdminCartPriceRulesFormSection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<section name="AdminCartPriceRulesFormSection">
1111
<element name="save" type="button" selector="#save" timeout="30"/>
1212
<element name="saveAndContinue" type="button" selector="#save_and_continue" timeout="30"/>
13-
<element name="delete" type="button" selector="#delete" timeout="30"/>
13+
<element name="delete" type="button" selector="button#delete" timeout="30"/>
1414
<element name="modalAcceptButton" type="button" selector="button.action-accept" timeout="30"/>
1515

1616
<!-- Rule Information (the main form on the page) -->

dev/tests/integration/testsuite/Magento/Backend/Block/Widget/Button/SplitButtonTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ public function testToHtml(): void
7979
);
8080

8181
$html = $block->toHtml();
82-
$this->assertContains('<button ', $html);
83-
$this->assertContains('<span>A button</span>', $html);
84-
$this->assertNotContains('onclick=', $html);
85-
$this->assertNotContains('style=', $html);
86-
$this->assertRegExp('/\<script.*?\>.*?' . preg_quote($onclick) . '.*?\<\/script\>/ims', $html);
87-
$this->assertContains('width', $html);
88-
$this->assertContains('100px', $html);
82+
$this->assertStringContainsString('<button ', $html);
83+
$this->assertStringContainsString('<span>A button</span>', $html);
84+
$this->assertStringNotContainsString('onclick=', $html);
85+
$this->assertStringNotContainsString('style=', $html);
86+
$this->assertMatchesRegularExpression('/\<script.*?\>.*?' . preg_quote($onclick) . '.*?\<\/script\>/ims', $html);
87+
$this->assertStringContainsString('width', $html);
88+
$this->assertStringContainsString('100px', $html);
8989
}
9090
}

dev/tests/integration/testsuite/Magento/Backend/Block/Widget/ButtonTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ public function testToHtml(): void
7272
);
7373

7474
$html = $block->toHtml();
75-
$this->assertContains('<button ', $html);
76-
$this->assertContains('<span>A button</span>', $html);
77-
$this->assertNotContains('onclick=', $html);
78-
$this->assertNotContains('style=', $html);
79-
$this->assertRegExp('/\<script.*?\>.*?' .preg_quote($block->getOnClick()) .'.*?\<\/script\>/ims', $html);
80-
$this->assertContains('height', $html);
81-
$this->assertContains('200px', $html);
75+
$this->assertStringContainsString('<button ', $html);
76+
$this->assertStringContainsString('<span>A button</span>', $html);
77+
$this->assertStringNotContainsString('onclick=', $html);
78+
$this->assertStringNotContainsString('style=', $html);
79+
$this->assertMatchesRegularExpression('/\<script.*?\>.*?' .preg_quote($block->getOnClick()) .'.*?\<\/script\>/ims', $html);
80+
$this->assertStringContainsString('height', $html);
81+
$this->assertStringContainsString('200px', $html);
8282
}
8383
}

dev/tests/integration/testsuite/Magento/Csp/Model/Collector/ConfigCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private function getExpectedPolicies(): array
4545
'child-src',
4646
false,
4747
['http://magento.com', 'http://devdocs.magento.com'],
48-
['http'],
48+
['http', 'https', 'blob'],
4949
true,
5050
true,
5151
false,

dev/tests/integration/testsuite/Magento/Framework/View/Helper/SecureHtmlRendererTemplateTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ public function testTemplateUsage(): void
2828
$this->dispatch('securehtml/secure/helper');
2929
$content = $this->getResponse()->getContent();
3030

31-
$this->assertContains(
31+
$this->assertStringContainsString(
3232
'<h1 onclick="alert&#x28;&#x29;">Hello there!</h1>',
3333
$content
3434
);
35-
$this->assertContains(
35+
$this->assertStringContainsString(
3636
'<script src="http&#x3A;&#x2F;&#x2F;my.magento.com&#x2F;static&#x2F;script.js"/>',
3737
$content
3838
);
39-
$this->assertContains(
39+
$this->assertStringContainsString(
4040
"<script>\n let myVar = 1;\n</script>",
4141
$content
4242
);
43-
$this->assertContains(
43+
$this->assertStringContainsString(
4444
'<div>I am just &lt;a&gt; text</div>',
4545
$content
4646
);

dev/tests/integration/testsuite/Magento/Framework/View/Helper/SecureHtmlRendererTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@ public function testRenderEventHandler(): void
9797
public function testRenderEventListenerAsTag(): void
9898
{
9999
$html = $this->helper->renderEventListenerAsTag('onclick', 'alert(1)', '#id');
100-
$this->assertContains('alert(1)', $html);
101-
$this->assertContains('#id', $html);
102-
$this->assertContains('click', $html);
100+
$this->assertStringContainsString('alert(1)', $html);
101+
$this->assertStringContainsString('#id', $html);
102+
$this->assertStringContainsString('click', $html);
103103
}
104104

105105
/**
@@ -121,21 +121,21 @@ public function testInvalidEventListener(): void
121121
public function testRenderStyleAsTag(): void
122122
{
123123
$html = $this->helper->renderStyleAsTag('display: none; font-size: 3em; ', '#id');
124-
$this->assertContains('#id', $html);
125-
$this->assertContains('display', $html);
126-
$this->assertContains('none', $html);
127-
$this->assertContains('fontSize', $html);
128-
$this->assertContains('3em', $html);
124+
$this->assertStringContainsString('#id', $html);
125+
$this->assertStringContainsString('display', $html);
126+
$this->assertStringContainsString('none', $html);
127+
$this->assertStringContainsString('fontSize', $html);
128+
$this->assertStringContainsString('3em', $html);
129129
}
130130

131131
/**
132132
* Check style validation
133133
*
134134
* @return void
135-
* @expectedException \InvalidArgumentException
136135
*/
137136
public function testInvalidStyle(): void
138137
{
138+
$this->expectException(\InvalidArgumentException::class);
139139
$this->helper->renderStyleAsTag('display;', '');
140140
}
141141
}

dev/tests/integration/testsuite/Magento/Ui/Component/Control/ButtonTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ public function testToHtml(): void
7272
);
7373

7474
$html = $block->toHtml();
75-
$this->assertContains('<button ', $html);
76-
$this->assertContains('<span>A button control</span>', $html);
77-
$this->assertNotContains('onclick=', $html);
78-
$this->assertNotContains('style=', $html);
79-
$this->assertRegExp('/\<script.*?\>.*?' .preg_quote($onclick) .'.*?\<\/script\>/ims', $html);
80-
$this->assertContains('height', $html);
81-
$this->assertContains('200px', $html);
75+
$this->assertStringContainsString('<button ', $html);
76+
$this->assertStringContainsString('<span>A button control</span>', $html);
77+
$this->assertStringNotContainsString('onclick=', $html);
78+
$this->assertStringNotContainsString('style=', $html);
79+
$this->assertMatchesRegularExpression('/\<script.*?\>.*?' .preg_quote($onclick) .'.*?\<\/script\>/ims', $html);
80+
$this->assertStringContainsString('height', $html);
81+
$this->assertStringContainsString('200px', $html);
8282
}
8383
}

dev/tests/integration/testsuite/Magento/Ui/Component/Control/SplitButtonTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ public function testToHtml(): void
8181
);
8282

8383
$html = $block->toHtml();
84-
$this->assertContains('<button ', $html);
85-
$this->assertContains('<span>Split button control</span>', $html);
86-
$this->assertNotContains('onclick=', $html);
87-
$this->assertNotContains('style=', $html);
88-
$this->assertRegExp('/\<script.*?\>.*?' . preg_quote($onclick) . '.*?\<\/script\>/ims', $html);
89-
$this->assertContains('width', $html);
90-
$this->assertContains('100px', $html);
84+
$this->assertStringContainsString('<button ', $html);
85+
$this->assertStringContainsString('<span>Split button control</span>', $html);
86+
$this->assertStringNotContainsString('onclick=', $html);
87+
$this->assertStringNotContainsString('style=', $html);
88+
$this->assertMatchesRegularExpression('/\<script.*?\>.*?' . preg_quote($onclick) . '.*?\<\/script\>/ims', $html);
89+
$this->assertStringContainsString('width', $html);
90+
$this->assertStringContainsString('100px', $html);
9191
}
9292
}

lib/internal/Magento/Framework/View/Test/Unit/Element/Html/LinkTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ class LinkTest extends TestCase
3333
*/
3434
private $objectManager;
3535

36-
protected function setUp(): void
37-
{
38-
$this->objectManager = new ObjectManager($this);
39-
}
40-
4136
/**
4237
* @var array
4338
*/

0 commit comments

Comments
 (0)