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 7
7
declare (strict_types=1 );
8
8
9
9
use Magento \Catalog \Api \ProductRepositoryInterface ;
10
- use Magento \Catalog \Model \Product ;
11
10
use Magento \Framework \Exception \NoSuchEntityException ;
12
11
use Magento \Framework \ObjectManagerInterface ;
13
12
use Magento \TestFramework \Helper \Bootstrap ;
16
15
$ objectManager = Bootstrap::getObjectManager ();
17
16
18
17
/**
19
- * @var Product $productModel
20
18
* @var ProductRepositoryInterface $productRepository
21
19
*/
22
- $ productModel = $ objectManager ->create (Product::class);
23
20
$ productRepository = $ objectManager ->create (ProductRepositoryInterface::class);
24
21
$ skus = ['AdvancedPricingSimple 1 ' , 'AdvancedPricingSimple 2 ' ];
25
22
foreach ($ skus as $ sku ) {
26
23
try {
27
- $ product = $ productRepository ->getById ($ sku );
28
- $ productRepository ->delete ($ product );
24
+ $ product = $ productRepository ->deleteById ($ sku );
29
25
} catch (NoSuchEntityException $ exception ) {
30
26
// product already removed
31
27
}
You can’t perform that action at this time.
0 commit comments