24
24
use Magento \ConfigurableProduct \Model \Product \Type \Configurable as TypeConfigurable ;
25
25
use Magento \Eav \Api \Data \AttributeOptionInterface ;
26
26
use Magento \Eav \Model \AttributeRepository ;
27
+ use Magento \Eav \Model \Config as EavConfig ;
28
+ use Magento \Eav \Model \Entity \Attribute \Source \Table ;
27
29
use Magento \Framework \App \Filesystem \DirectoryList ;
28
30
use Magento \Framework \Filesystem ;
29
31
use Magento \Framework \Filesystem \Directory \WriteInterface ;
30
32
use Magento \Framework \Registry ;
31
33
use Magento \TestFramework \TestCase \AbstractController ;
32
34
use Magento \TestFramework \Helper \Bootstrap ;
33
-
34
35
/**
35
- * class DataTest
36
+ * Class DataTest
36
37
*
37
38
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
38
39
*/
39
40
class DataTest extends AbstractController
40
41
{
41
-
42
42
const SWATCH_ATTRIBUTE_NAME = 'test_swatch_attribute ' ;
43
43
const CATEGORY_NAME = 'test_category ' ;
44
44
const CATEGORY_ID = 123456 ;
@@ -268,12 +268,12 @@ private static function productFixtureRollback()
268
268
*/
269
269
private static function attributeFixture ()
270
270
{
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 );
274
274
$ data = [
275
275
'is_required ' => 0 ,
276
- 'source_model ' => ' Magento\Eav\Model\Entity\Attribute\Source\ Table' ,
276
+ 'source_model ' => Table::class ,
277
277
'is_visible_on_front ' => 1 ,
278
278
'is_visible_in_advanced_search ' => 0 ,
279
279
'attribute_code ' => self ::SWATCH_ATTRIBUTE_NAME ,
@@ -300,6 +300,7 @@ function ($values, $index) use ($optionsPerAttribute) {
300
300
dechex (255 * $ index / $ optionsPerAttribute ),
301
301
3
302
302
);
303
+
303
304
return $ values ;
304
305
},
305
306
[]
@@ -308,6 +309,7 @@ function ($values, $index) use ($optionsPerAttribute) {
308
309
range (1 , $ optionsPerAttribute ),
309
310
function ($ values , $ index ) {
310
311
$ values ['option_ ' . $ index ] = ['option ' . $ index ];
312
+
311
313
return $ values ;
312
314
},
313
315
[]
@@ -319,6 +321,7 @@ function ($values, $index) {
319
321
'label ' => 'option ' . $ index ,
320
322
'value ' => 'option_ ' . $ index
321
323
];
324
+
322
325
return $ values ;
323
326
},
324
327
[]
0 commit comments