-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
magento-engcom/import-export-improvements#42: create an image type pr…
…ocessor to enable more modular testing
- Loading branch information
Showing
4 changed files
with
70 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
app/code/Magento/CatalogImportExport/Model/Import/Product/ImageTypeProcessor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\CatalogImportExport\Model\Import\Product; | ||
|
||
class ImageTypeProcessor | ||
{ | ||
/** | ||
* @return array | ||
*/ | ||
public function getImageTypes() | ||
{ | ||
return ['image', 'small_image', 'thumbnail', 'swatch_image', '_media_image']; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...ode/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/ImageTypeProcessorTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\CatalogImportExport\Test\Unit\Model\Import\Product; | ||
|
||
use Magento\CatalogImportExport\Model\Import\Product\ImageTypeProcessor; | ||
|
||
class ImageTypeProcessorTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
public function testGetImageTypes() | ||
{ | ||
$typeProcessor = new ImageTypeProcessor(); | ||
$this->assertEquals( | ||
['image', 'small_image', 'thumbnail', 'swatch_image', '_media_image'], | ||
$typeProcessor->getImageTypes() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters