66namespace Magento \AdvancedPricingImportExport \Model \Import ;
77
88use Magento \Catalog \Api \ProductRepositoryInterface ;
9+ use Magento \Catalog \Test \Fixture \SelectAttribute ;
910use Magento \Framework \App \Filesystem \DirectoryList ;
1011use Magento \Framework \Filesystem ;
1112use Magento \ImportExport \Model \Import ;
@@ -430,16 +431,29 @@ private function generateImportFile(array $data): string
430431
431432 /**
432433 * 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
442434 */
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+ ]
443457 public function testImportAddUpdateCounts ()
444458 {
445459 $ this ->model = $ this ->objectManager ->create (\Magento \CatalogImportExport \Model \Import \Product::class);
@@ -453,7 +467,7 @@ public function testImportAddUpdateCounts()
453467 true ,
454468 'catalog_product '
455469 );
456-
470+ print_r ( $ errors -> getAllErrors ());
457471 $ this ->assertEquals (0 , $ errors ->getErrorsCount (), 'Product import validation error ' );
458472 $ this ->model ->importData ();
459473
@@ -466,6 +480,7 @@ public function testImportAddUpdateCounts()
466480 );
467481 $ pathToFile = __DIR__ . '/_files/import_advanced_pricing_for_additional_attributes_products.csv ' ;
468482 $ errors = $ this ->doImport ($ pathToFile , DirectoryList::ROOT , Import::BEHAVIOR_APPEND , true );
483+ print_r ($ errors ->getAllErrors ());
469484 $ this ->assertEquals (0 , $ errors ->getErrorsCount (), 'Advanced pricing import validation error ' );
470485 $ this ->model ->importData ();
471486
0 commit comments