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 4
4
* See COPYING.txt for license details.
5
5
*/
6
6
7
- use Magento \Catalog \Api \Data \ProductInterface ;
8
-
9
7
$ objectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
10
8
11
9
/** @var \Magento\Framework\Registry $registry */
15
13
$ registry ->register ("isSecureArea " , true );
16
14
17
15
/** @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
+ }
21
21
22
22
/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
23
23
$ productRepository = $ objectManager ->create (\Magento \Catalog \Api \ProductRepositoryInterface::class);
24
24
25
25
try {
26
26
$ firstProduct = $ productRepository ->get ('unique-simple-azaza ' );
27
- $ firstProduct ->delete ();
27
+ $ productRepository ->delete ($ firstProduct );
28
28
} catch (\Magento \Framework \Exception \NoSuchEntityException $ exception ) {
29
29
//Product already removed
30
30
}
You can’t perform that action at this time.
0 commit comments