protected function setUp() { $this->_markTestAsRestOnly("JSON generation tests are intended to be executed for REST adapter only."); $this->storeCode = Bootstrap::getObjectManager()->get('Magento\\Store\\Model\\StoreManagerInterface')->getStore()->getCode(); $this->productMetadata = Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\ProductMetadataInterface'); parent::setUp(); }
protected function setUp() { $this->_markTestAsSoapOnly("WSDL generation tests are intended to be executed for SOAP adapter only."); $this->_storeCode = Bootstrap::getObjectManager()->get('Magento\\Store\\Model\\StoreManagerInterface')->getStore()->getCode(); $this->_soapUrl = "{$this->_baseUrl}/soap/{$this->_storeCode}?wsdl=1&services=testModuleMSCAllSoapAndRestV1"; parent::setUp(); }
/** * Ensure that fixture customer and his addresses are deleted. */ protected function tearDown() { /** @var \Magento\Framework\Registry $registry */ $registry = Bootstrap::getObjectManager()->get('Magento\\Framework\\Registry'); $registry->unregister('isSecureArea'); $registry->register('isSecureArea', true); try { $fixtureFirstAddressId = 1; $this->addressRepository->deleteById($fixtureFirstAddressId); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { /** First address fixture was not used */ } try { $fixtureSecondAddressId = 2; $this->addressRepository->deleteById($fixtureSecondAddressId); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { /** Second address fixture was not used */ } try { $fixtureCustomerId = 1; $this->customerRepository->deleteById($fixtureCustomerId); } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { /** Customer fixture was not used */ } $registry->unregister('isSecureArea'); $registry->register('isSecureArea', false); parent::tearDown(); }
protected function tearDown() { $this->deleteCart('test_order_1'); $this->deleteCart('test_order_1_with_payment'); $this->deleteCart('test_order_with_virtual_product'); $this->deleteCart('test_order_with_virtual_product_without_address'); parent::tearDown(); }
public function __construct($name = null, array $data = [], $dataName = '') { parent::__construct($name, $data, $dataName); $this->customerAddressFactory = Bootstrap::getObjectManager()->create('Magento\\Customer\\Api\\Data\\AddressInterfaceFactory'); $this->customerDataFactory = Bootstrap::getObjectManager()->create('Magento\\Customer\\Api\\Data\\CustomerInterfaceFactory'); $this->dataObjectHelper = Bootstrap::getObjectManager()->create('Magento\\Framework\\Api\\DataObjectHelper'); $this->dataObjectProcessor = Bootstrap::getObjectManager()->create('Magento\\Framework\\Reflection\\DataObjectProcessor'); }
protected function tearDown() { parent::tearDown(); $this->_oAuthClients = []; if (isset(self::$_consumer)) { self::$_consumer->delete(); self::$_token->delete(); } }
protected function tearDown() { try { $cart = $this->getCart('test01'); $cart->delete(); } catch (\InvalidArgumentException $e) { // Do nothing if cart fixture was not used } parent::tearDown(); }
/** * Ensure that fixture customer and his addresses are deleted. */ public function tearDown() { unset($this->customerRepository); /** @var \Magento\Framework\Registry $registry */ $registry = Bootstrap::getObjectManager()->get('Magento\\Framework\\Registry'); $registry->unregister('isSecureArea'); $registry->register('isSecureArea', true); $registry->unregister('isSecureArea'); $registry->register('isSecureArea', false); parent::tearDown(); }
/** * Execute per test cleanup */ public function tearDown() { /** @var \Magento\Framework\Registry $registry */ $registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\Registry'); $registry->unregister('isSecureArea'); $registry->register('isSecureArea', true); $this->productCollection->addFieldToFilter('sku', ['in' => ['sku-test-product-bundle']])->delete(); unset($this->productCollection); $registry->unregister('isSecureArea'); $registry->register('isSecureArea', false); parent::tearDown(); }
protected function tearDown() { try { $cart = $this->getCart('test01'); $cart->delete(); /** @var \Magento\Quote\Model\QuoteIdMask $quoteIdMask */ $quoteIdMask = $this->objectManager->create('Magento\\Quote\\Model\\QuoteIdMask'); $quoteIdMask->delete($cart->getId()); } catch (\InvalidArgumentException $e) { // Do nothing if cart fixture was not used } parent::tearDown(); }
/** * 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); }
protected function setUp() { $this->_markTestAsSoapOnly(); parent::setUp(); }
protected function setUp() { $this->_markTestAsSoapOnly("WSDL generation tests are intended to be executed for SOAP adapter only."); $this->_storeCode = Bootstrap::getObjectManager()->get('Magento\\Store\\Model\\StoreManagerInterface')->getStore()->getCode(); parent::setUp(); }
/** * Cleaning up the extra groups that might have been created as part of the testing. */ public static function tearDownAfterClass() { parent::tearDownAfterClass(); }
/** * Execute per test cleanup */ public function tearDown() { $this->deleteProductBySku(self::BUNDLE_PRODUCT_ID); parent::tearDown(); }
/** * 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(); } }
protected function tearDown() { unset($this->integration); OauthHelper::clearApiAccessCredentials(); parent::tearDown(); }
/** * Execute per test cleanup */ public function tearDown() { $this->deleteProductBySku(self::PRODUCT_SKU); parent::tearDown(); }
protected function setUp() { $this->_markTestAsRestOnly(); $this->mode = Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\State')->getMode(); parent::setUp(); }