Skip to content

Commit f05dd7f

Browse files
#24754: Integration tests fix.
1 parent 684e8fb commit f05dd7f

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/FetchRatesTest.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,30 @@
66

77
namespace Magento\CurrencySymbol\Controller\Adminhtml\System\Currency;
88

9+
use Magento\Framework\Escaper;
10+
911
/**
1012
* Fetch Rates Test
1113
*/
1214
class FetchRatesTest extends \Magento\TestFramework\TestCase\AbstractBackendController
1315
{
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+
1433
/**
1534
* Test fetch action without service
1635
*
@@ -46,7 +65,11 @@ public function testFetchRatesActionWithNonexistentService(): void
4665
$this->dispatch('backend/admin/system_currency/fetchRates');
4766

4867
$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+
),
5073
\Magento\Framework\Message\MessageInterface::TYPE_ERROR
5174
);
5275
}

dev/tests/integration/testsuite/Magento/CurrencySymbol/Controller/Adminhtml/System/Currency/SaveRatesTest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,23 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\CurrencySymbol\Controller\Adminhtml\System\Currency;
78

89
use Magento\Framework\App\Request\Http as HttpRequest;
10+
use Magento\Framework\Escaper;
911

1012
class SaveRatesTest extends \Magento\TestFramework\TestCase\AbstractBackendController
1113
{
1214

1315
/** @var \Magento\Directory\Model\Currency $currencyRate */
1416
protected $currencyRate;
1517

18+
/**
19+
* @var Escaper
20+
*/
21+
private $escaper;
22+
1623
/**
1724
* Initial setup
1825
*/
@@ -21,6 +28,10 @@ protected function setUp()
2128
$this->currencyRate = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
2229
\Magento\Directory\Model\Currency::class
2330
);
31+
$this->escaper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
32+
Escaper::class
33+
);
34+
2435
parent::setUp();
2536
}
2637

@@ -89,7 +100,9 @@ public function testSaveWithWarningAction()
89100

90101
$this->assertSessionMessages(
91102
$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+
)
93106
),
94107
\Magento\Framework\Message\MessageInterface::TYPE_WARNING
95108
);

0 commit comments

Comments
 (0)