@@ -241,6 +241,67 @@ public function testGetProcessedTemplate($variables, $templateType, $storeId, $e
241
241
$ this ->assertEquals ($ expectedResult , $ model ->getProcessedTemplate ($ variables ));
242
242
}
243
243
244
+ /**
245
+ * @expectedException \LogicException
246
+ */
247
+ public function testGetProcessedTemplateException () {
248
+ $ filterTemplate = $ this ->getMockBuilder (\Magento \Email \Model \Template \Filter::class)
249
+ ->setMethods ([
250
+ 'setUseSessionInUrl ' ,
251
+ 'setPlainTemplateMode ' ,
252
+ 'setIsChildTemplate ' ,
253
+ 'setDesignParams ' ,
254
+ 'setVariables ' ,
255
+ 'setStoreId ' ,
256
+ 'filter ' ,
257
+ 'getStoreId ' ,
258
+ 'getInlineCssFiles ' ,
259
+ ])
260
+ ->disableOriginalConstructor ()
261
+ ->getMock ();
262
+ $ filterTemplate ->expects ($ this ->once ())
263
+ ->method ('setUseSessionInUrl ' )
264
+ ->will ($ this ->returnSelf ());
265
+ $ filterTemplate ->expects ($ this ->once ())
266
+ ->method ('setPlainTemplateMode ' )
267
+ ->will ($ this ->returnSelf ());
268
+ $ filterTemplate ->expects ($ this ->once ())
269
+ ->method ('setIsChildTemplate ' )
270
+ ->will ($ this ->returnSelf ());
271
+ $ filterTemplate ->expects ($ this ->once ())
272
+ ->method ('setDesignParams ' )
273
+ ->will ($ this ->returnSelf ());
274
+ $ filterTemplate ->expects ($ this ->any ())
275
+ ->method ('setStoreId ' )
276
+ ->will ($ this ->returnSelf ());
277
+ $ filterTemplate ->expects ($ this ->any ())
278
+ ->method ('getStoreId ' )
279
+ ->will ($ this ->returnValue (1 ));
280
+
281
+ $ model = $ this ->getModelMock ([
282
+ 'getDesignParams ' ,
283
+ 'applyDesignConfig ' ,
284
+ 'getTemplateText ' ,
285
+ 'isPlain ' ,
286
+ ]);
287
+
288
+ $ designParams = [
289
+ 'area ' => \Magento \Framework \App \Area::AREA_FRONTEND ,
290
+ 'theme ' => 'themeId ' ,
291
+ 'locale ' => 'localeId ' ,
292
+ ];
293
+ $ model ->expects ($ this ->any ())
294
+ ->method ('getDesignParams ' )
295
+ ->will ($ this ->returnValue ($ designParams ));
296
+ $ model ->setTemplateFilter ($ filterTemplate );
297
+ $ model ->setTemplateType (\Magento \Framework \App \TemplateTypesInterface::TYPE_TEXT );
298
+
299
+ $ filterTemplate ->expects ($ this ->once ())
300
+ ->method ('filter ' )
301
+ ->will ($ this ->throwException (new \Exception ));
302
+ $ model ->getProcessedTemplate ([]);
303
+ }
304
+
244
305
/**
245
306
* @return array
246
307
*/
0 commit comments