File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1086,10 +1086,10 @@ public function filter($value)
1086
1086
if ($ this ->_appState ->getMode () == \Magento \Framework \App \State::MODE_DEVELOPER ) {
1087
1087
$ value = sprintf (__ ('Error filtering template: %s ' ), $ e ->getMessage ());
1088
1088
} else {
1089
- $ value = __ ("We're sorry, an error has occurred while generating this content. " );
1089
+ $ value = ( string ) __ ("We're sorry, an error has occurred while generating this content. " );
1090
1090
}
1091
1091
$ this ->_logger ->critical ($ e );
1092
1092
}
1093
- return ( string ) $ value ;
1093
+ return $ value ;
1094
1094
}
1095
1095
}
Original file line number Diff line number Diff line change @@ -271,6 +271,16 @@ protected function getModel($mockedMethods = null)
271
271
->getMock ();
272
272
}
273
273
274
+ /**
275
+ * Test exception handling of filter method
276
+ */
277
+ public function testFilterExceptionHandler ()
278
+ {
279
+ $ filter = $ this ->getModel ();
280
+ $ filteredValue = $ filter ->filter (null );
281
+ $ this ->assertInternalType ('string ' , $ filteredValue );
282
+ }
283
+
274
284
/**
275
285
* Test basic usages of applyInlineCss
276
286
*
You can’t perform that action at this time.
0 commit comments