File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed
dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 6
6
7
7
namespace Magento \CurrencySymbol \Controller \Adminhtml \System \Currency ;
8
8
9
+ use Magento \Framework \Escaper ;
10
+
9
11
/**
10
12
* Fetch Rates Test
11
13
*/
12
14
class FetchRatesTest extends \Magento \TestFramework \TestCase \AbstractBackendController
13
15
{
16
+ /**
17
+ * @var Escaper
18
+ */
19
+ private $ escaper ;
20
+
21
+ /**
22
+ * Initial setup
23
+ */
24
+ protected function setUp ()
25
+ {
26
+ $ this ->escaper = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
27
+ Escaper::class
28
+ );
29
+
30
+ parent ::setUp ();
31
+ }
32
+
14
33
/**
15
34
* Test fetch action without service
16
35
*
@@ -46,7 +65,11 @@ public function testFetchRatesActionWithNonexistentService(): void
46
65
$ this ->dispatch ('backend/admin/system_currency/fetchRates ' );
47
66
48
67
$ this ->assertSessionMessages (
49
- $ this ->contains ("The import model can't be initialized. Verify the model and try again. " ),
68
+ $ this ->contains (
69
+ $ this ->escaper ->escapeHtml (
70
+ "The import model can't be initialized. Verify the model and try again. "
71
+ )
72
+ ),
50
73
\Magento \Framework \Message \MessageInterface::TYPE_ERROR
51
74
);
52
75
}
Original file line number Diff line number Diff line change 3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+
6
7
namespace Magento \CurrencySymbol \Controller \Adminhtml \System \Currency ;
7
8
8
9
use Magento \Framework \App \Request \Http as HttpRequest ;
10
+ use Magento \Framework \Escaper ;
9
11
10
12
class SaveRatesTest extends \Magento \TestFramework \TestCase \AbstractBackendController
11
13
{
12
14
13
15
/** @var \Magento\Directory\Model\Currency $currencyRate */
14
16
protected $ currencyRate ;
15
17
18
+ /**
19
+ * @var Escaper
20
+ */
21
+ private $ escaper ;
22
+
16
23
/**
17
24
* Initial setup
18
25
*/
@@ -21,6 +28,10 @@ protected function setUp()
21
28
$ this ->currencyRate = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
22
29
\Magento \Directory \Model \Currency::class
23
30
);
31
+ $ this ->escaper = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ()->create (
32
+ Escaper::class
33
+ );
34
+
24
35
parent ::setUp ();
25
36
}
26
37
@@ -89,7 +100,9 @@ public function testSaveWithWarningAction()
89
100
90
101
$ this ->assertSessionMessages (
91
102
$ this ->contains (
92
- (string )__ ('Please correct the input data for "%1 => %2" rate. ' , $ currencyCode , $ currencyTo )
103
+ $ this ->escaper ->escapeHtml (
104
+ (string )__ ('Please correct the input data for "%1 => %2" rate. ' , $ currencyCode , $ currencyTo )
105
+ )
93
106
),
94
107
\Magento \Framework \Message \MessageInterface::TYPE_WARNING
95
108
);
You can’t perform that action at this time.
0 commit comments