/** * Remove test store */ public static function tearDownAfterClass() { parent::tearDownAfterClass(); /** @var \Magento\Framework\Registry $registry */ $registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\Registry'); $registry->unregister('isSecureArea'); $registry->register('isSecureArea', true); /** @var $store \Magento\Store\Model\Store */ $store = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Store\\Model\\Store'); $store->load('fixturestore'); if ($store->getId()) { $store->delete(); } $registry->unregister('isSecureArea'); $registry->register('isSecureArea', false); }
/** * Cleaning up the extra groups that might have been created as part of the testing. */ public static function tearDownAfterClass() { parent::tearDownAfterClass(); }
/** * Remove test attribute */ public static function tearDownAfterClass() { parent::tearDownAfterClass(); /** @var \Magento\Customer\Model\Attribute $attribute */ $attribute = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Customer\\Model\\Attribute'); foreach (['custom_attribute1', 'custom_attribute2'] as $attributeCode) { $attribute->loadByCode('customer_address', $attributeCode); $attribute->delete(); } }