6
6
namespace Magento \AdvancedPricingImportExport \Model \Import ;
7
7
8
8
use Magento \Catalog \Api \ProductRepositoryInterface ;
9
+ use Magento \Catalog \Test \Fixture \SelectAttribute ;
9
10
use Magento \Framework \App \Filesystem \DirectoryList ;
10
11
use Magento \Framework \Filesystem ;
11
12
use Magento \ImportExport \Model \Import ;
@@ -430,16 +431,29 @@ private function generateImportFile(array $data): string
430
431
431
432
/**
432
433
* For checking if correct add and update count are being displayed after importing file having 100+ records
433
- *
434
- * @magentoDataFixture Magento\Catalog\Test\Fixture\SelectAttribute as:attr1
435
- * @magentoDataFixture Magento\Catalog\Test\Fixture\SelectAttribute as:attr2
436
- *
437
- * phpcs:disable Generic.Files.LineLength.TooLong
438
- * @magentoDataFixtureDataProvider {"attr1":{"attribute_code":"size","default_frontend_label":"Size","scope":"global","options":[28,29,30,31,32,33,34,36,38]}}
439
- * @magentoDataFixtureDataProvider {"attr2":{"attribute_code":"colors","default_frontend_label":"Colors","scope":"global","options":["Red","Green","Yellow","Blue","Orange"]}}
440
- * phpcs:enable Generic.Files.LineLength.TooLong
441
- * @magentoAppArea adminhtml
442
434
*/
435
+ #[
436
+ DataFixture(
437
+ SelectAttribute::class,
438
+ [
439
+ 'attribute_code ' => 'size ' ,
440
+ 'default_frontend_label ' => 'Size ' ,
441
+ 'scope ' =>'global ' ,
442
+ 'options ' =>[28 ,29 ,30 ,31 ,32 ,33 ,34 ,36 ,38 ]
443
+ ],
444
+ 'attr1 '
445
+ ),
446
+ DataFixture(
447
+ SelectAttribute::class,
448
+ [
449
+ 'attribute_code ' => 'colors ' ,
450
+ 'default_frontend_label ' => 'Colors ' ,
451
+ 'scope ' =>'global ' ,
452
+ 'options ' =>["Red " ,"Green " ,"Yellow " ,"Blue " ,"Orange " ]
453
+ ]
454
+ ),
455
+ AppArea('adminhtml ' )
456
+ ]
443
457
public function testImportAddUpdateCounts ()
444
458
{
445
459
$ this ->model = $ this ->objectManager ->create (\Magento \CatalogImportExport \Model \Import \Product::class);
@@ -453,7 +467,7 @@ public function testImportAddUpdateCounts()
453
467
true ,
454
468
'catalog_product '
455
469
);
456
-
470
+ print_r ( $ errors -> getAllErrors ());
457
471
$ this ->assertEquals (0 , $ errors ->getErrorsCount (), 'Product import validation error ' );
458
472
$ this ->model ->importData ();
459
473
@@ -466,6 +480,7 @@ public function testImportAddUpdateCounts()
466
480
);
467
481
$ pathToFile = __DIR__ . '/_files/import_advanced_pricing_for_additional_attributes_products.csv ' ;
468
482
$ errors = $ this ->doImport ($ pathToFile , DirectoryList::ROOT , Import::BEHAVIOR_APPEND , true );
483
+ print_r ($ errors ->getAllErrors ());
469
484
$ this ->assertEquals (0 , $ errors ->getErrorsCount (), 'Advanced pricing import validation error ' );
470
485
$ this ->model ->importData ();
471
486
0 commit comments