/**
  * @dataProvider dataForVariationWithSwatchImage
  */
 public function testLoadFirstVariationWithSwatchImage($imageTypes, $expected, $requiredAttributes)
 {
     $this->getSwatchAttributes($this->productMock);
     $this->getUsedProducts($imageTypes + $requiredAttributes);
     $result = $this->swatchHelperObject->loadFirstVariationWithSwatchImage($this->productMock, $requiredAttributes);
     if ($expected === false) {
         $this->assertFalse($result);
     } else {
         $this->assertInstanceOf('\\Magento\\Catalog\\Model\\Product', $result);
     }
 }
Example #2
0
 public function testLoadFirstVariationWithSwatchImageWithoutProduct()
 {
     $this->swatchHelperObject->loadFirstVariationWithSwatchImage($this->productMock, 'color', 31);
 }