Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DataTest.php
Go to the documentation of this file.
1 <?php
8 
14 
18 class DataTest extends \PHPUnit\Framework\TestCase
19 {
21  protected $imageHelperMock;
22 
25 
28 
30  protected $configurableMock;
31 
34 
36  protected $productMock;
37 
39  protected $storeManagerMock;
40 
43 
45  protected $attributeMock;
46 
48  protected $objectManager;
49 
52 
54  protected $productRepoMock;
55 
57  private $metaDataPoolMock;
58 
62  private $swatchAttributesProvider;
63 
67  private $imageUrlBuilderMock;
68 
69  protected function setUp()
70  {
71  $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
72  $this->imageHelperMock = $this->createMock(\Magento\Catalog\Helper\Image::class);
73  $this->productCollectionFactoryMock = $this->createPartialMock(
74  \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory::class,
75  ['create']
76  );
77  $this->productMock = $this->createMock(\Magento\Catalog\Model\Product::class);
78  $this->productCollectionMock = $this->objectManager->getCollectionMock(
79  \Magento\Catalog\Model\ResourceModel\Product\Collection::class,
80  [
81  $this->productMock,
82  $this->productMock,
83  ]
84  );
85 
86  $this->configurableMock = $this->createMock(
87  \Magento\ConfigurableProduct\Model\Product\Type\Configurable::class
88  );
89  $this->productModelFactoryMock = $this->createPartialMock(
90  \Magento\Catalog\Model\ProductFactory::class,
91  ['create']
92  );
93 
94  $this->productRepoMock = $this->createMock(\Magento\Catalog\Api\ProductRepositoryInterface::class);
95 
96  $this->storeManagerMock = $this->createMock(\Magento\Store\Model\StoreManager::class);
97  $this->swatchCollectionFactoryMock = $this->createPartialMock(
98  \Magento\Swatches\Model\ResourceModel\Swatch\CollectionFactory::class,
99  ['create']
100  );
101 
102  $this->attributeMock = $this->getMockBuilder(Attribute::class)
103  ->disableOriginalConstructor()
104  ->setMethods(['setStoreId', 'getData', 'setData', 'getSource', 'hasData'])
105  ->getMock();
106  $this->metaDataPoolMock = $this->getMockBuilder(MetadataPool::class)
107  ->disableOriginalConstructor()
108  ->getMock();
109 
110  $serializer = $this->createPartialMock(
111  \Magento\Framework\Serialize\Serializer\Json::class,
112  ['serialize', 'unserialize']
113  );
114  $serializer->expects($this->any())
115  ->method('serialize')->willReturnCallback(function ($parameter) {
116  return json_encode($parameter);
117  });
118  $serializer->expects($this->any())
119  ->method('unserialize')->willReturnCallback(function ($parameter) {
120  return json_decode($parameter, true);
121  });
122 
123  $this->swatchAttributesProvider = $this->getMockBuilder(SwatchAttributesProvider::class)
124  ->disableOriginalConstructor()
125  ->getMock();
126  $this->imageUrlBuilderMock = $this->getMockBuilder(\Magento\Catalog\Model\Product\Image\UrlBuilder::class)
127  ->disableOriginalConstructor()
128  ->setMethods(['getUrl'])
129  ->getMock();
130 
131  $this->swatchHelperObject = $this->objectManager->getObject(
132  \Magento\Swatches\Helper\Data::class,
133  [
134  'productCollectionFactory' => $this->productCollectionFactoryMock,
135  'configurable' => $this->configurableMock,
136  'productRepository' => $this->productRepoMock,
137  'storeManager' => $this->storeManagerMock,
138  'swatchCollectionFactory' => $this->swatchCollectionFactoryMock,
139  'imageUrlBuilder' => $this->imageUrlBuilderMock,
140  'serializer' => $serializer,
141  'swatchAttributesProvider' => $this->swatchAttributesProvider,
142  ]
143  );
144  $this->objectManager->setBackwardCompatibleProperty(
145  $this->swatchHelperObject,
146  'metadataPool',
147  $this->metaDataPoolMock
148  );
149  }
150 
154  public function dataForAdditionalData()
155  {
156  $additionalData = [
157  'swatch_input_type' => 'visual',
158  'update_product_preview_image' => 1,
159  'use_product_image_for_swatch' => 0
160  ];
161  return [
162  [
163  json_encode($additionalData),
164  [
165  'getData' => 1,
166  'setData' => 3,
167  ]
168  ],
169  [
170  null,
171  [
172  'getData' => 1,
173  'setData' => 0,
174  ]
175  ],
176  ];
177  }
178 
183  {
184  $this->attributeMock
185  ->expects($this->at(0))
186  ->method('getData')
187  ->with('additional_data')
188  ->will($this->returnValue($dataFromDb));
189 
190  $i = 1;
191  foreach ($attributeData as $key => $value) {
192  $this->attributeMock
193  ->expects($this->at($i))
194  ->method('getData')
195  ->with($key)
196  ->willReturn($value);
197  $i++;
198  }
199 
200  $this->attributeMock->expects($this->once())->method('setData');
201 
202  $this->swatchHelperObject->assembleAdditionalDataEavAttribute($this->attributeMock);
203  }
204 
208  public function dataForAssembleEavAttribute()
209  {
210  $additionalData = [
211  'swatch_input_type' => 'visual',
212  'update_product_preview_image' => 1,
213  'use_product_image_for_swatch' => 0
214  ];
215  return [
216  [
217  json_encode($additionalData),
218  [
219  'swatch_input_type' => 'visual',
220  'update_product_preview_image' => 1,
221  'use_product_image_for_swatch' => 1,
222  ],
223  ],
224  [
225  null,
226  [
227  'swatch_input_type' => null,
228  'update_product_preview_image' => 0,
229  'use_product_image_for_swatch' => 0,
230  ],
231  ],
232  ];
233  }
234 
238  public function testLoadFirstVariationWithSwatchImage($imageTypes, $expected, $requiredAttributes)
239  {
240  $this->getSwatchAttributes($this->productMock);
241  $this->getUsedProducts($imageTypes + $requiredAttributes, $imageTypes);
242 
243  $result = $this->swatchHelperObject->loadFirstVariationWithSwatchImage($this->productMock, $requiredAttributes);
244 
245  if ($expected === false) {
246  $this->assertFalse($result);
247  } else {
248  $this->assertInstanceOf(\Magento\Catalog\Model\Product::class, $result);
249  }
250  }
251 
256  {
257  return [
258  [
259  [
260  'image' => '/m/a/magento.png',
261  'small_image' => '/m/a/magento.png',
262  'thumbnail' => '/m/a/magento.png',
263  'swatch_image' => '/m/a/magento.png', //important
264  ],
265  \Magento\Catalog\Model\Product::class,
266  ['color' => 31],
267  ],
268  [
269  [
270  'image' => '/m/a/magento.png',
271  'small_image' => '/m/a/magento.png',
272  'thumbnail' => '/m/a/magento.png',
273  ],
274  false,
275  ['size' => 31],
276  ],
277  ];
278  }
279 
284  {
285  $metadataMock = $this->createMock(\Magento\Framework\EntityManager\EntityMetadataInterface::class);
286  $this->metaDataPoolMock->expects($this->once())->method('getMetadata')->willReturn($metadataMock);
287  $metadataMock->expects($this->once())->method('getLinkField')->willReturn('id');
288 
290 
292 
293  $this->productCollectionMock->method('getFirstItem')->willReturn($this->productMock);
294  $this->productMock->method('getData')->with('id')->willReturn(95);
295  $this->productModelFactoryMock->method('create')->willReturn($this->productMock);
296  $this->productMock->method('load')->with(95)->will($this->returnSelf());
297 
298  $this->swatchHelperObject->loadVariationByFallback($this->productMock, ['color' => 31]);
299  }
300 
304  public function testLoadFirstVariationWithImage($imageTypes, $expected, $requiredAttributes)
305  {
306  $this->getSwatchAttributes($this->productMock);
307  $this->getUsedProducts($imageTypes + $requiredAttributes, $imageTypes);
308 
309  $result = $this->swatchHelperObject->loadFirstVariationWithImage($this->productMock, $requiredAttributes);
310 
311  if ($expected === false) {
312  $this->assertFalse($result);
313  } else {
314  $this->assertInstanceOf(\Magento\Catalog\Model\Product::class, $result);
315  }
316  }
317 
321  public function dataForVariationWithImage()
322  {
323  return [
324  [
325  [
326  'image' => '/m/a/magento.png', //important
327  'small_image' => '/m/a/magento.png',
328  'thumbnail' => '/m/a/magento.png',
329  'swatch_image' => '/m/a/magento.png',
330  ],
331  \Magento\Catalog\Model\Product::class,
332  ['color' => 31],
333  ],
334  [
335  [
336  'small_image' => '/m/a/magento.png',
337  'thumbnail' => '/m/a/magento.png',
338  'swatch_image' => '/m/a/magento.png',
339  ],
340  false,
341  ['size' => 31],
342  ],
343  ];
344  }
345 
347  {
348  $result = $this->swatchHelperObject->loadVariationByFallback($this->productMock, ['color' => 31]);
349  $this->assertFalse($result);
350  }
351 
353  {
354  $result = $this->swatchHelperObject->loadFirstVariationWithImage($this->productMock, ['color' => 31]);
355  $this->assertFalse($result);
356  }
357 
361  public function testGetProductMediaGallery($mediaGallery, $image)
362  {
363  $mediaGalleryEntries = [];
364  $id = 0;
365  $mediaUrls = [];
366  foreach ($mediaGallery as $mediaType => $mediaFile) {
367  $mediaGalleryEntryMock = $this->getMockBuilder(
368  \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
369  )->getMock();
370  $mediaGalleryEntryMock->expects($this->atLeastOnce())
371  ->method('isDisabled')
372  ->willReturn(false);
373  $mediaGalleryEntryMock->expects($this->atLeastOnce())
374  ->method('getTypes')
375  ->willReturn([$mediaType]);
376  $mediaGalleryEntryMock->expects($this->atLeastOnce())
377  ->method('getFile')
378  ->willReturn($mediaFile);
379  $mediaGalleryEntryMock->expects($this->atLeastOnce())
380  ->method('getId')
381  ->willReturn(++$id);
382 
383  $mediaGalleryEntries[] = $mediaGalleryEntryMock;
384  $mediaUrls[] = [$mediaFile, 'product_swatch_image_large', 'http://full_path_to_image' . $mediaFile];
385  $mediaUrls[] = [$mediaFile, 'product_swatch_image_medium' ,'http://full_path_to_image' . $mediaFile];
386  $mediaUrls[] = [$mediaFile, 'product_swatch_image_small','http://full_path_to_image' . $mediaFile];
387  }
388 
389  $this->productMock->expects($this->once())
390  ->method('getMediaGalleryEntries')
391  ->willReturn($mediaGalleryEntries);
392 
393  if ($mediaGallery) {
394  $this->imageUrlBuilderMock->expects($this->any())
395  ->method('getUrl')
396  ->willReturnMap($mediaUrls);
397  }
398 
399  $productMediaGallery = $this->swatchHelperObject->getProductMediaGallery($this->productMock);
400  if ($mediaGallery) {
401  $this->assertContains($image, $productMediaGallery['large']);
402  $this->assertContains($image, $productMediaGallery['medium']);
403  $this->assertContains($image, $productMediaGallery['small']);
404  } else {
405  $this->assertEmpty($productMediaGallery);
406  }
407  }
408 
412  public function dataForMediaGallery()
413  {
414  return [
415  [
416  [
417  'image' => '/m/a/magento1.png',
418  'small_image' => '/m/a/magento2.png',
419  'thumbnail' => '/m/a/magento3.png',
420  'swatch_image' => '/m/a/magento4.png',
421  ],
422  '/m/a/magento1.png',
423  ],
424  [
425  [
426  'small_image' => '/m/a/magento4.png',
427  'thumbnail' => '/m/a/magento5.png',
428  'swatch_image' => '/m/a/magento6.png',
429  ],
430  '/m/a/magento4.png',
431  ],
432  [
433  [],
434  ''
435  ],
436  ];
437  }
438 
439  protected function getSwatchAttributes()
440  {
442  $returnFromProvideMethod = [$this->attributeMock];
443  $this->swatchAttributesProvider
444  ->method('provide')
445  ->with($this->productMock)
446  ->willReturn($returnFromProvideMethod);
447  }
448 
453  protected function getUsedProducts(array $attributes, array $imageTypes)
454  {
455  $this->productMock
456  ->expects($this->atLeastOnce())
457  ->method('getTypeInstance')
458  ->willReturn($this->configurableMock);
459 
460  $simpleProducts = [];
461  for ($i = 0; $i < 2; $i++) {
462  $simpleProduct = $this->getMockBuilder(\Magento\Catalog\Model\Product::class)
463  ->disableOriginalConstructor()
464  ->setMethods(['hasData', 'getMediaGalleryEntries'])
465  ->getMock();
466  $simpleProduct->setData($attributes);
467 
468  $mediaGalleryEntries = [];
469  foreach (array_keys($imageTypes) as $mediaType) {
470  $mediaGalleryEntryMock = $this->getMockBuilder(
471  \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface::class
472  )->getMock();
473  $mediaGalleryEntryMock->expects($this->any())
474  ->method('isDisabled')
475  ->willReturn(false);
476  $mediaGalleryEntryMock->expects($this->any())
477  ->method('getTypes')
478  ->willReturn([$mediaType]);
479 
480  $mediaGalleryEntries[] = $mediaGalleryEntryMock;
481  }
482  $simpleProduct->expects($this->any())
483  ->method('getMediaGalleryEntries')
484  ->willReturn($mediaGalleryEntries);
485 
487  }
488 
489  $this->configurableMock->expects($this->once())
490  ->method('getUsedProducts')
491  ->with($this->productMock)
492  ->willReturn($simpleProducts);
493  }
494 
495  protected function getAttributesFromConfigurable()
496  {
497  $confAttribute = $this->createMock(
498  \Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute::class
499  );
500 
501  $this->configurableMock
502  ->expects($this->any())
503  ->method('getConfigurableAttributes')
504  ->with($this->productMock)
505  ->willReturn([$confAttribute, $confAttribute]);
506 
507  $confAttribute
508  ->expects($this->any())
509  ->method('__call')
510  ->with('getProductAttribute')
511  ->willReturn($this->attributeMock);
512  }
513 
514  protected function prepareVariationCollection()
515  {
516  $this->productCollectionFactoryMock
517  ->expects($this->any())
518  ->method('create')
519  ->willReturn($this->productCollectionMock);
520 
521  $this->addfilterByParent();
522  }
523 
524  protected function addfilterByParent()
525  {
526  $this->productCollectionMock
527  ->method('getTable')
528  ->with('catalog_product_relation')
529  ->willReturn('catalog_product_relation');
530 
531  $zendDbSelectMock = $this->createMock(\Magento\Framework\DB\Select::class);
532 
533  $this->productCollectionMock->method('getSelect')->willReturn($zendDbSelectMock);
534  $zendDbSelectMock->method('join')->willReturn($zendDbSelectMock);
535  $zendDbSelectMock->method('where')->willReturn($zendDbSelectMock);
536  }
537 
541  public function dataForCreateSwatchProduct()
542  {
543  $productMock = $this->createMock(\Magento\Catalog\Model\Product::class);
544 
545  return [
546  [
547  $productMock,
548  [
549  'image' => '',
550  'small_image' => '',
551  'thumbnail' => '',
552  'swatch_image' => '',
553  ]
554  ],
555  [
556  $productMock,
557  [
558  'small_image' => 'img1.png',
559  'thumbnail' => 'img1.png',
560  ]
561  ],
562  [
563  $productMock,
564  []
565  ],
566  [
567  $productMock,
568  [
569  'image' => 'img1.png',
570  'small_image' => 'img1.png',
571  'thumbnail' => 'img1.png',
572  ]
573  ],
574  ];
575  }
576 
581  {
582  $productMock = $this->createMock(\Magento\Catalog\Model\Product::class);
583 
584  return [
585  [
586  95,
587  ],
588  [
589  $productMock,
590  ],
591  ];
592  }
593 
597  public function testGetSwatchAttributesAsArray($optionsArray, $attributeData, $expected)
598  {
599  $this->swatchAttributesProvider
600  ->method('provide')
601  ->with($this->productMock)
602  ->willReturn([$this->attributeMock]);
603 
604  $storeId = 1;
605 
606  $this->attributeMock->method('setStoreId')->with($storeId)->will($this->returnSelf());
607  $storeMock = $this->createMock(\Magento\Store\Model\Store::class);
608  $storeMock->method('getId')->willReturn($storeId);
609  $this->storeManagerMock->method('getStore')->willReturn($storeMock);
610 
611  $this->attributeMock->method('getData')->with('')->willReturn($attributeData);
612 
613  $sourceMock = $this->createMock(\Magento\Eav\Model\Entity\Attribute\Source\AbstractSource::class);
614  $sourceMock->expects($this->any())->method('getAllOptions')->with(false)->willReturn($optionsArray);
615  $this->attributeMock->method('getSource')->willReturn($sourceMock);
616 
617  $result = $this->swatchHelperObject->getSwatchAttributesAsArray($this->productMock);
618  $this->assertEquals($result, $expected);
619  }
620 
624  public function dataForGettingSwatchAsArray()
625  {
626  return [
627  [
628  [
629  ['value' => 45, 'label' => 'green'],
630  ['value' => 46, 'label' => 'yellow'],
631  ['value' => 47, 'label' => 'red'],
632  ['value' => 48, 'label' => 'blue'],
633  ],
634  [
635  'attribute_id' => 52
636  ],
637  [
638  52 => [
639  'attribute_id' => 52,
640  'options' => [
641  45 => 'green',
642  46 => 'yellow',
643  47 => 'red',
644  48 => 'blue',
645  ],
646  ]
647  ],
648  ],
649  [
650  [
651  ['value' => 45, 'label' => 'green'],
652  ['value' => 46, 'label' => 'yellow'],
653  ],
654  [
655  'attribute_id' => 324
656  ],
657  [
658  324 => [
659  'attribute_id' => 324,
660  'options' => [
661  45 => 'green',
662  46 => 'yellow',
663  ],
664  ]
665  ],
666  ],
667  ];
668  }
669 
671  {
672  $swatchMock = $this->createMock(\Magento\Swatches\Model\Swatch::class);
673 
674  $optionsData = [
675  [
676  'type' => 1,
677  'store_id' => 1,
678  'value' => '#324234',
679  'option_id' => 35,
680  'id' => 423,
681  ],
682  [
683  'type' => 0,
684  'store_id' => 0,
685  'value' => 'test2',
686  'option_id' => 35,
687  'id' => 424,
688  ]
689  ];
690 
691  $swatchMock->expects($this->at(0))->method('offsetGet')->with('type')
692  ->willReturn($optionsData[0]['type']);
693  $swatchMock->expects($this->at(1))->method('offsetGet')->with('option_id')
694  ->willReturn($optionsData[0]['option_id']);
695  $swatchMock->expects($this->at(2))->method('getData')->with('')
696  ->willReturn($optionsData[0]);
697  $swatchMock->expects($this->at(3))->method('offsetGet')->with('type')
698  ->willReturn($optionsData[1]['type']);
699  $swatchMock->expects($this->at(4))->method('offsetGet')->with('store_id')
700  ->willReturn($optionsData[1]['store_id']);
701  $swatchMock->expects($this->at(5))->method('offsetGet')->with('store_id')
702  ->willReturn($optionsData[1]['store_id']);
703  $swatchMock->expects($this->at(6))->method('offsetGet')->with('option_id')
704  ->willReturn($optionsData[1]['option_id']);
705  $swatchMock->expects($this->at(7))->method('getData')->with('')
706  ->willReturn($optionsData[1]);
707 
708  $swatchCollectionMock = $this->objectManager
709  ->getCollectionMock(Collection::class, [$swatchMock, $swatchMock]);
710  $swatchCollectionMock->method('addFilterByOptionsIds')->with([35])->will($this->returnSelf());
711  $this->swatchCollectionFactoryMock->method('create')->willReturn($swatchCollectionMock);
712 
713  $storeMock = $this->createMock(\Magento\Store\Model\Store::class);
714  $this->storeManagerMock->method('getStore')->willReturn($storeMock);
715  $storeMock->method('getId')->willReturn(1);
716 
717  $this->swatchHelperObject->getSwatchesByOptionsId([35]);
718  }
719 
721  {
722  $swatchMock = $this->createMock(\Magento\Swatches\Model\Swatch::class);
723 
724  $optionsData = [
725  [
726  'type' => 0,
727  'store_id' => 1,
728  'value' => 'test',
729  'option_id' => 35,
730  'id' => 487,
731  ],
732  [
733  'type' => 0,
734  'store_id' => 1,
735  'value' => 'test2',
736  'option_id' => 36,
737  'id' => 488,
738  ]
739  ];
740 
741  $swatchMock->expects($this->at(0))->method('offsetGet')->with('type')->willReturn(0);
742  $swatchMock->expects($this->at(1))->method('offsetGet')->with('store_id')->willReturn(1);
743  $swatchMock->expects($this->at(2))->method('offsetGet')->with('value')->willReturn('test');
744  $swatchMock->expects($this->at(3))->method('offsetGet')->with('option_id')->willReturn(35);
745  $swatchMock->expects($this->at(4))->method('getData')->with('')->willReturn($optionsData[0]);
746  $swatchMock->expects($this->at(5))->method('offsetGet')->with('type')->willReturn(0);
747  $swatchMock->expects($this->at(6))->method('offsetGet')->with('store_id')->willReturn(1);
748  $swatchMock->expects($this->at(7))->method('offsetGet')->with('value')->willReturn('test2');
749  $swatchMock->expects($this->at(8))->method('offsetGet')->with('option_id')->willReturn(36);
750  $swatchMock->expects($this->at(9))->method('getData')->with('')->willReturn($optionsData[1]);
751 
752  $swatchCollectionMock = $this->objectManager->getCollectionMock(
753  Collection::class,
754  [
755  $swatchMock,
756  $swatchMock,
757  ]
758  );
759  $this->swatchCollectionFactoryMock->method('create')->willReturn($swatchCollectionMock);
760 
761  $swatchCollectionMock->method('addFilterByOptionsIds')->with([35])->will($this->returnSelf());
762 
763  $storeMock = $this->createMock(\Magento\Store\Model\Store::class);
764  $this->storeManagerMock->method('getStore')->willReturn($storeMock);
765  $storeMock->method('getId')->willReturn(1);
766 
767  $this->swatchHelperObject->getSwatchesByOptionsId([35]);
768  }
769 
771  {
772  $swatchMock = $this->createMock(\Magento\Swatches\Model\Swatch::class);
773 
774  $optionsData = [
775  'type' => 0,
776  'store_id' => 0,
777  'value' => 'test_test',
778  'option_id' => 35,
779  'id' => 423,
780  ];
781 
782  $swatchMock->expects($this->at(0))->method('offsetGet')->with('type')->willReturn(0);
783  $swatchMock->expects($this->at(1))->method('offsetGet')->with('store_id')->willReturn(0);
784  $swatchMock->expects($this->at(2))->method('offsetGet')->with('store_id')->willReturn(0);
785  $swatchMock->expects($this->at(3))->method('offsetGet')->with('option_id')->willReturn(35);
786  $swatchMock->expects($this->at(4))->method('getData')->with('')->willReturn($optionsData);
787 
788  $swatchCollectionMock = $this->objectManager->getCollectionMock(
789  Collection::class,
790  [
791  $swatchMock,
792  ]
793  );
794  $this->swatchCollectionFactoryMock->method('create')->willReturn($swatchCollectionMock);
795 
796  $swatchCollectionMock->method('addFilterByOptionsIds')->with([35])->will($this->returnSelf());
797 
798  $storeMock = $this->createMock(\Magento\Store\Model\Store::class);
799  $this->storeManagerMock->method('getStore')->willReturn($storeMock);
800  $storeMock->method('getId')->willReturn(1);
801 
802  $this->swatchHelperObject->getSwatchesByOptionsId([35]);
803  }
804 
805  public function testIsProductHasSwatch()
806  {
807  $this->getSwatchAttributes();
808  $result = $this->swatchHelperObject->isProductHasSwatch($this->productMock);
809  $this->assertEquals(true, $result);
810  }
811 }
testGetProductMediaGallery($mediaGallery, $image)
Definition: DataTest.php:361
$id
Definition: fieldset.phtml:14
getUsedProducts(array $attributes, array $imageTypes)
Definition: DataTest.php:453
testAssembleAdditionalDataEavAttribute($dataFromDb, $attributeData)
Definition: DataTest.php:182
$value
Definition: gender.phtml:16
testGetSwatchAttributesAsArray($optionsArray, $attributeData, $expected)
Definition: DataTest.php:597
testLoadFirstVariationWithImage($imageTypes, $expected, $requiredAttributes)
Definition: DataTest.php:304
$attributes
Definition: matrix.phtml:13
$simpleProducts[]
testLoadFirstVariationWithSwatchImage($imageTypes, $expected, $requiredAttributes)
Definition: DataTest.php:238
$i
Definition: gallery.phtml:31