Your IP : 216.73.216.43


Current Path : /home/rtorresani/www/dev/tests/integration/testsuite/Magento/Catalog/_files/
Upload File :
Current File : //home/rtorresani/www/dev/tests/integration/testsuite/Magento/Catalog/_files/validate_image.php

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();

/** @var \Magento\Framework\Filesystem $filesystem */
$filesystem = $objectManager->create(\Magento\Framework\Filesystem::class);

/** @var $tmpDirectory \Magento\Framework\Filesystem\Directory\WriteInterface */
$tmpDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::SYS_TMP);
$tmpDirectory->create($tmpDirectory->getAbsolutePath());

$targetTmpFilePath = $tmpDirectory->getAbsolutePath('magento_small_image.jpg');
copy(__DIR__ . '/magento_small_image.jpg', $targetTmpFilePath);
// Copying the image to target dir is not necessary because during product save, it will be moved there from tmp dir

$targetTmpFilePath = $tmpDirectory->getAbsolutePath('magento_empty.jpg');
copy(__DIR__ . '/magento_empty.jpg', $targetTmpFilePath);