Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
product_simple_with_all_fields_rollback.php
Go to the documentation of this file.
1 <?php
8 include __DIR__ . '/product_simple_rollback.php';
9 
10 
13 $registry = $objectManager->get(\Magento\Framework\Registry::class);
14 
15 $registry->unregister('isSecureArea');
16 $registry->register('isSecureArea', true);
17 
18 //Remove categories
20 $collection = $objectManager->create(\Magento\Catalog\Model\ResourceModel\Category\Collection::class);
21 foreach ($collection->addAttributeToFilter('level', ['in' => [2, 3, 4]]) as $category) {
23  $category->delete();
24 }
25 
26 $registry->unregister('isSecureArea');
27 $registry->register('isSecureArea', false);
defined('TESTS_BP')||define('TESTS_BP' __DIR__
Definition: _bootstrap.php:60