File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
lib/internal/Magento/Framework/View/Test/Unit Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1919use Magento \Framework \View \Element \AbstractBlock ;
2020use Magento \Framework \View \Element \Template ;
2121use Magento \Framework \View \Layout ;
22+ use Magento \Framework \View \Layout \BuilderInterface ;
2223use Magento \Framework \View \Layout \Data \Structure as LayoutStructure ;
2324use Magento \Framework \View \Layout \Element ;
2425use Magento \Framework \View \Layout \Generator \Block ;
@@ -1169,4 +1170,27 @@ public function renderElementDisplayDataProvider(): array
11691170 [null ],
11701171 ];
11711172 }
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+ }
11721196}
You can’t perform that action at this time.
0 commit comments