Skip to content

Commit 480da7d

Browse files
committed
MAGETWO-69501: Swatch-color was not replaced by image
1 parent 4596a3b commit 480da7d

File tree

1 file changed

+10
-7
lines changed
  • dev/tests/integration/testsuite/Magento/Swatches/Helper

1 file changed

+10
-7
lines changed

dev/tests/integration/testsuite/Magento/Swatches/Helper/DataTest.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@
2424
use Magento\ConfigurableProduct\Model\Product\Type\Configurable as TypeConfigurable;
2525
use Magento\Eav\Api\Data\AttributeOptionInterface;
2626
use Magento\Eav\Model\AttributeRepository;
27+
use Magento\Eav\Model\Config as EavConfig;
28+
use Magento\Eav\Model\Entity\Attribute\Source\Table;
2729
use Magento\Framework\App\Filesystem\DirectoryList;
2830
use Magento\Framework\Filesystem;
2931
use Magento\Framework\Filesystem\Directory\WriteInterface;
3032
use Magento\Framework\Registry;
3133
use Magento\TestFramework\TestCase\AbstractController;
3234
use Magento\TestFramework\Helper\Bootstrap;
33-
3435
/**
35-
* class DataTest
36+
* Class DataTest
3637
*
3738
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3839
*/
3940
class DataTest extends AbstractController
4041
{
41-
4242
const SWATCH_ATTRIBUTE_NAME = 'test_swatch_attribute';
4343
const CATEGORY_NAME = 'test_category';
4444
const CATEGORY_ID = 123456;
@@ -268,12 +268,12 @@ private static function productFixtureRollback()
268268
*/
269269
private static function attributeFixture()
270270
{
271-
$eavConfig = Bootstrap::getObjectManager()->get('Magento\Eav\Model\Config');
272-
/** @var $installer \Magento\Catalog\Setup\CategorySetup */
273-
$installer = Bootstrap::getObjectManager()->create('Magento\Catalog\Setup\CategorySetup');
271+
$eavConfig = Bootstrap::getObjectManager()->get(EavConfig::class);
272+
/** @var $installer CategorySetup */
273+
$installer = Bootstrap::getObjectManager()->create(CategorySetup::class);
274274
$data = [
275275
'is_required' => 0,
276-
'source_model' => 'Magento\Eav\Model\Entity\Attribute\Source\Table',
276+
'source_model' => Table::class,
277277
'is_visible_on_front' => 1,
278278
'is_visible_in_advanced_search' => 0,
279279
'attribute_code' => self::SWATCH_ATTRIBUTE_NAME,
@@ -300,6 +300,7 @@ function ($values, $index) use ($optionsPerAttribute) {
300300
dechex(255 * $index / $optionsPerAttribute),
301301
3
302302
);
303+
303304
return $values;
304305
},
305306
[]
@@ -308,6 +309,7 @@ function ($values, $index) use ($optionsPerAttribute) {
308309
range(1, $optionsPerAttribute),
309310
function ($values, $index) {
310311
$values['option_' . $index] = ['option ' . $index];
312+
311313
return $values;
312314
},
313315
[]
@@ -319,6 +321,7 @@ function ($values, $index) {
319321
'label' => 'option ' . $index,
320322
'value' => 'option_' . $index
321323
];
324+
322325
return $values;
323326
},
324327
[]

0 commit comments

Comments
 (0)