Skip to content

Commit

Permalink
428 - Test coverage: GetAvailableShippingMethodsTest
Browse files Browse the repository at this point in the history
  • Loading branch information
atwixfirster committed Mar 26, 2019
1 parent 38dd5a0 commit 18e41ba
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/** @var \Magento\Framework\ObjectManagerInterface $objectManager */
$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();

/** @var \Magento\Framework\Registry $registry */
$registry = $objectManager->get(\Magento\Framework\Registry::class);

$registry->unregister('isSecureArea');
$registry->register('isSecureArea', true);

/** @var \Magento\Catalog\Api\ProductRepositoryInterface $productRepository */
$productRepository = $objectManager->create(\Magento\Catalog\Api\ProductRepositoryInterface::class);

try {
$product = $productRepository->get('simple', false, null, true);
$productRepository->delete($product);
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
//Product already removed
}

$registry->unregister('isSecureArea');
$registry->register('isSecureArea', false);

0 comments on commit 18e41ba

Please sign in to comment.