/** * @param bool $hasFile * @param bool $mediaExists * * @dataProvider getUpdateProductValueData */ public function testUpdateProductValue($hasFile, $mediaExists) { $f = tempnam('/tmp', 'pim-media-transformer-test'); $this->media = $mediaExists ? new FileInfo() : null; $file = $hasFile ? new FileInfo() : null; $transformer = new MediaTransformer($this->fileStorer); $productValue = $this->getValue($hasFile, $mediaExists); $columnInfo = $this->getMock('Pim\\Bundle\\TransformBundle\\Transformer\\ColumnInfo\\ColumnInfoInterface'); $transformer->setValue($productValue, $columnInfo, $file); if ($hasFile) { $this->assertEquals($file, $this->media); } unlink($f); }