File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed
dev/tests/integration/testsuite/Magento/AdvancedPricingImportExport/_files Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change 77declare (strict_types=1 );
88
99use Magento \Catalog \Api \ProductRepositoryInterface ;
10- use Magento \Catalog \Model \Product ;
1110use Magento \Framework \Exception \NoSuchEntityException ;
1211use Magento \Framework \ObjectManagerInterface ;
1312use Magento \TestFramework \Helper \Bootstrap ;
1615$ objectManager = Bootstrap::getObjectManager ();
1716
1817/**
19- * @var Product $productModel
2018 * @var ProductRepositoryInterface $productRepository
2119 */
22- $ productModel = $ objectManager ->create (Product::class);
2320$ productRepository = $ objectManager ->create (ProductRepositoryInterface::class);
2421$ skus = ['AdvancedPricingSimple 1 ' , 'AdvancedPricingSimple 2 ' ];
2522foreach ($ skus as $ sku ) {
2623 try {
27- $ product = $ productRepository ->getById ($ sku );
28- $ productRepository ->delete ($ product );
24+ $ product = $ productRepository ->deleteById ($ sku );
2925 } catch (NoSuchEntityException $ exception ) {
3026 // product already removed
3127 }
You can’t perform that action at this time.
0 commit comments