@@ -186,25 +186,21 @@ public function varDirectiveDataProvider()
186
186
*/
187
187
public function testLoopPattern ($ construction , $ variables , $ expectedResult )
188
188
{
189
-
190
189
$ this ->templateFilter ->setVariables ($ variables );
191
190
$ this ->assertEquals ($ expectedResult , $ this ->invokeMethod ($ this ->templateFilter , 'filterFor ' , [$ construction ]));
192
191
}
193
192
194
-
195
193
/**
196
194
* @return array
197
195
*/
198
196
public function loopPatternDataProvider ()
199
197
{
200
-
201
198
return [
202
199
'no loop tag ' => $ this ->getTemplateAndExpectedResults ('noLoopTag ' ),
203
200
'no loop body tag ' => $ this ->getTemplateAndExpectedResults ('noBodyTag ' ),
204
201
'no item tag ' => $ this ->getTemplateAndExpectedResults ('noItemTag ' ),
205
202
'no item, no body tags ' => $ this ->getTemplateAndExpectedResults ('noItemNoBodyTag ' ),
206
203
'no item, no data, no body tags ' => $ this ->getTemplateAndExpectedResults ('noItemNoDataNoBodyTag ' ),
207
-
208
204
];
209
205
}
210
206
@@ -232,7 +228,6 @@ private function invokeMethod(&$object, $methodName, array $parameters = [])
232
228
*/
233
229
public function getTemplateAndExpectedResults ($ type )
234
230
{
235
-
236
231
switch ($ type ) {
237
232
case 'noLoopTag ' :
238
233
$ template = $ expected = '' ;
@@ -306,7 +301,8 @@ public function getTemplateAndExpectedResults($type)
306
301
<ul>
307
302
{{for item in order.all_visible_items}}
308
303
<li>
309
- index: {{var loop.index}} sku: {{var item.sku}} name: {{var item.name}} price: {{var item.price}} quantity: {{var item.ordered_qty}}
304
+ index: {{var loop.index}} sku: {{var item.sku}}
305
+ name: {{var item.name}} price: {{var item.price}} quantity: {{var item.ordered_qty}}
310
306
</li>
311
307
{{/for}}
312
308
</ul>
@@ -315,22 +311,19 @@ public function getTemplateAndExpectedResults($type)
315
311
<ul>
316
312
317
313
<li>
318
- index: 0 sku: ABC123 name: Product ABC price: 123 quantity: 2
314
+ index: 0 sku: ABC123
315
+ name: Product ABC price: 123 quantity: 2
319
316
</li>
320
317
321
318
<li>
322
- index: 1 sku: DOREMI name: Product DOREMI price: 456 quantity: 1
319
+ index: 1 sku: DOREMI
320
+ name: Product DOREMI price: 456 quantity: 1
323
321
</li>
324
322
325
323
</ul>
326
324
TEMPLATE ;
327
-
328
325
}
329
- return [
330
- $ template ,
331
- ['order ' => $ this ->getObjectData ()],
332
- $ expected
333
- ];
326
+ return [$ template , ['order ' => $ this ->getObjectData ()], $ expected ];
334
327
}
335
328
336
329
/**
@@ -339,7 +332,7 @@ public function getTemplateAndExpectedResults($type)
339
332
private function getObjectData ()
340
333
{
341
334
$ objectManager = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
342
- $ dataObject = $ objectManager ->getObject (' \Magento\Framework\DataObject ' );
335
+ $ dataObject = $ objectManager ->getObject (\Magento \Framework \DataObject::class );
343
336
344
337
/* $var @dataObject \Magento\Framework\DataObject */
345
338
0 commit comments