File tree 2 files changed +3
-5
lines changed
Test/Unit/Ui/Component/Listing/Column
Ui/Component/Listing/Column
2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public function testPrepareDataSource()
47
47
{
48
48
$ itemName = 'itemName ' ;
49
49
$ oldItemValue = "itemValue \n" ;
50
- $ newItemValue = ' itemValue<br/> ' ;
50
+ $ newItemValue = " itemValue<br /> \n" ;
51
51
$ dataSource = [
52
52
'data ' => [
53
53
'items ' => [
@@ -57,7 +57,7 @@ public function testPrepareDataSource()
57
57
];
58
58
59
59
$ this ->model ->setData ('name ' , $ itemName );
60
- $ this ->escaper ->expects ($ this ->once ())->method ('escapeHtml ' )->with ($ newItemValue )->willReturnArgument (0 );
60
+ $ this ->escaper ->expects ($ this ->any ())->method ('escapeHtml ' )->with ($ oldItemValue )->willReturnArgument (0 );
61
61
$ dataSource = $ this ->model ->prepareDataSource ($ dataSource );
62
62
$ this ->assertEquals ($ newItemValue , $ dataSource ['data ' ]['items ' ][0 ][$ itemName ]);
63
63
}
Original file line number Diff line number Diff line change @@ -49,9 +49,7 @@ public function prepareDataSource(array $dataSource)
49
49
{
50
50
if (isset ($ dataSource ['data ' ]['items ' ])) {
51
51
foreach ($ dataSource ['data ' ]['items ' ] as & $ item ) {
52
- $ item [$ this ->getData ('name ' )] = $ this ->escaper ->escapeHtml (
53
- str_replace ("\n" , '<br/> ' , $ item [$ this ->getData ('name ' )])
54
- );
52
+ $ item [$ this ->getData ('name ' )] = nl2br ($ this ->escaper ->escapeHtml ($ item [$ this ->getData ('name ' )]));
55
53
}
56
54
}
57
55
You can’t perform that action at this time.
0 commit comments