Skip to content

Commit 2e85cdc

Browse files
author
Joan He
committed
MAGETWO-99282: Eliminate @escapeNotVerified in Magento_Catalog module
1 parent 4fc997e commit 2e85cdc

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

app/code/Magento/Backend/Test/Unit/Block/Widget/Grid/Column/Filter/TextTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager as ObjectManagerHelper;
1010

11+
/**
12+
* Unit test for \Magento\Backend\Block\Widget\Grid\Column\Filter\Text
13+
*/
1114
class TextTest extends \PHPUnit\Framework\TestCase
1215
{
1316
/** @var \Magento\Backend\Block\Widget\Grid\Column\Filter\Text*/
@@ -65,7 +68,11 @@ public function testGetHtml()
6568
$this->escaper->expects($this->any())->method('escapeHtml')->willReturn('escapedHtml');
6669
$this->escaper->expects($this->once())
6770
->method('escapeHtmlAttr')
68-
->willReturnCallback(function($string) {return $string;});
71+
->willReturnCallback(
72+
function ($string) {
73+
return $string;
74+
}
75+
);
6976
$column->expects($this->any())->method('getId')->willReturn('id');
7077
$column->expects($this->once())->method('getHtmlId')->willReturn('htmlId');
7178

lib/internal/Magento/Framework/View/Test/Unit/Element/AbstractBlockTest.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ public function testGetUiId($expectedResult, $nameInLayout, $methodArguments)
119119
{
120120
$this->escaperMock->expects($this->once())
121121
->method('escapeHtmlAttr')
122-
->willReturnCallback(function($string) {return $string;});
122+
->willReturnCallback(
123+
function ($string) {
124+
return $string;
125+
}
126+
);
123127
$this->block->setNameInLayout($nameInLayout);
124128
$this->assertEquals($expectedResult, call_user_func_array([$this->block, 'getUiId'], $methodArguments));
125129
}
@@ -166,10 +170,12 @@ public function testGetVar()
166170

167171
$config->expects($this->any())
168172
->method('getVarValue')
169-
->willReturnMap([
170-
['Magento_Theme', 'v1', 'one'],
171-
[$module, 'v2', 'two']
172-
]);
173+
->willReturnMap(
174+
[
175+
['Magento_Theme', 'v1', 'one'],
176+
[$module, 'v2', 'two']
177+
]
178+
);
173179

174180
$configManager = $this->createMock(ConfigInterface::class);
175181
$configManager->expects($this->exactly(2))->method('getViewConfig')->willReturn($config);

lib/internal/Magento/Framework/View/Test/Unit/Element/MessagesTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
use Magento\Framework\Message\Manager;
1414
use Magento\Framework\View\Element\Message\InterpretationStrategyInterface;
1515
use \Magento\Framework\View\Element\Messages;
16-
17-
use Magento\Framework\Message\ManagerInterface;
1816
use Magento\Framework\Message\MessageInterface;
1917

18+
/**
19+
* Unit test for \Magento\Framework\View\Element\Messages
20+
*/
2021
class MessagesTest extends \PHPUnit\Framework\TestCase
2122
{
2223
/**
@@ -330,7 +331,11 @@ public function testGetGroupedHtml()
330331

331332
$this->escaperMock->expects($this->any())
332333
->method('escapeHtmlAttr')
333-
->willReturnCallback(function($string) {return $string;});
334+
->willReturnCallback(
335+
function ($string) {
336+
return $string;
337+
}
338+
);
334339

335340
$this->assertEquals($resultHtml, $this->messages->getGroupedHtml());
336341
}

0 commit comments

Comments
 (0)