File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
dev/tests/integration/testsuite/Magento/Catalog/_files Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 44 * See COPYING.txt for license details.
55 */
66
7- use Magento \Catalog \Api \Data \ProductInterface ;
8-
97$ objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
108
119/** @var \Magento\Framework\Registry $registry */
1513$ registry ->register ("isSecureArea " , true );
1614
1715/** @var Magento\Store\Model\Website $website */
18- $ website = $ objectManager ->create (\Magento \Store \Model \Website::class);
19- $ website ->load ('second_website ' );
20- $ website ->delete ();
16+ $ website = $ objectManager ->get (Magento \Store \Model \Website::class);
17+ $ website ->load ('second_website ' , 'code ' );
18+ if ($ website ->getId ()) {
19+ $ website ->delete ();
20+ }
2121
2222/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
2323$ productRepository = $ objectManager ->create (\Magento \Catalog \Api \ProductRepositoryInterface::class);
2424
2525try {
2626 $ firstProduct = $ productRepository ->get ('unique-simple-azaza ' );
27- $ firstProduct ->delete ();
27+ $ productRepository ->delete ($ firstProduct );
2828} catch (\Magento \Framework \Exception \NoSuchEntityException $ exception ) {
2929 //Product already removed
3030}
You can’t perform that action at this time.
0 commit comments