/** * @dataProvider dataForVariationWithSwatchImage */ public function testLoadFirstVariationSwatchImage($imageTypes, $expected, $requiredAttributes) { $this->getSwatchAttributes($this->productMock); $this->getUsedProducts($imageTypes + $requiredAttributes); $result = $this->swatchHelperObject->loadFirstVariationSwatchImage($this->productMock, $requiredAttributes); if ($expected === false) { $this->assertFalse($result); } else { $this->assertInstanceOf('\\Magento\\Catalog\\Model\\Product', $result); } }