File tree 1 file changed +24
-0
lines changed
lib/internal/Magento/Framework/View/Test/Unit
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 19
19
use Magento \Framework \View \Element \AbstractBlock ;
20
20
use Magento \Framework \View \Element \Template ;
21
21
use Magento \Framework \View \Layout ;
22
+ use Magento \Framework \View \Layout \BuilderInterface ;
22
23
use Magento \Framework \View \Layout \Data \Structure as LayoutStructure ;
23
24
use Magento \Framework \View \Layout \Element ;
24
25
use Magento \Framework \View \Layout \Generator \Block ;
@@ -1169,4 +1170,27 @@ public function renderElementDisplayDataProvider(): array
1169
1170
[null ],
1170
1171
];
1171
1172
}
1173
+
1174
+ /**
1175
+ * Test render element with exception
1176
+ *
1177
+ * @return void
1178
+ */
1179
+ public function testRenderNonCachedElementWithException (): void
1180
+ {
1181
+ $ exception = new \Exception ('Error message ' );
1182
+
1183
+ $ builderMock = $ this ->createMock (BuilderInterface::class);
1184
+ $ builderMock ->expects ($ this ->once ())
1185
+ ->method ('build ' )
1186
+ ->willThrowException ($ exception );
1187
+
1188
+ $ this ->loggerMock ->expects ($ this ->once ())
1189
+ ->method ('critical ' )
1190
+ ->with ($ exception );
1191
+
1192
+ $ model = clone $ this ->model ;
1193
+ $ model ->setBuilder ($ builderMock );
1194
+ $ model ->renderNonCachedElement ('test_container ' );
1195
+ }
1172
1196
}
You can’t perform that action at this time.
0 commit comments