Skip to content

Commit 2fa5e83

Browse files
committed
MC-20421: [Integration Test] Verifying of email notifications about changes in the Company Credit
1 parent b169e62 commit 2fa5e83

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
use Magento\Catalog\Api\Data\ProductInterfaceFactory;
9+
use Magento\Catalog\Api\ProductRepositoryInterface;
10+
use Magento\Catalog\Model\Product\Attribute\Source\Status;
11+
use Magento\Catalog\Model\Product\Visibility;
12+
use Magento\TestFramework\Helper\Bootstrap;
13+
14+
$objectManager = Bootstrap::getObjectManager();
15+
/** @var ProductInterfaceFactory $productFactory */
16+
$productFactory = $objectManager->get(ProductInterfaceFactory::class);
17+
/** @var ProductRepositoryInterface $productRepository */
18+
$productRepository = $objectManager->get(ProductRepositoryInterface::class);
19+
20+
/** @var $product \Magento\Catalog\Model\Product */
21+
$product = $productFactory->create();
22+
$product->setTypeId('simple')
23+
->setAttributeSetId($product->getDefaultAttributeSetId())
24+
->setWebsiteIds([1])
25+
->setName('Simple Product Tax None')
26+
->setSku('simple-product-tax-none')
27+
->setPrice(205)
28+
->setWeight(1)
29+
->setMetaTitle('meta title')
30+
->setMetaKeyword('meta keyword')
31+
->setMetaDescription('meta description')
32+
->setVisibility(Visibility::VISIBILITY_BOTH)
33+
->setStatus(Status::STATUS_ENABLED)
34+
->setStockData(
35+
[
36+
'use_config_manage_stock' => 1,
37+
'qty' => 100,
38+
'is_in_stock' => 1
39+
]
40+
);
41+
42+
$productRepository->save($product);
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
use Magento\Catalog\Api\Data\ProductInterface;
9+
use Magento\Catalog\Api\ProductRepositoryInterface;
10+
use Magento\Framework\Exception\NoSuchEntityException;
11+
use Magento\TestFramework\Helper\Bootstrap;
12+
use Magento\TestFramework\ObjectManager;
13+
14+
/** @var ObjectManager $objectManager */
15+
$objectManager = Bootstrap::getObjectManager();
16+
/** @var ProductRepositoryInterface $productRepository */
17+
$productRepository = $objectManager->get(ProductRepositoryInterface::class);
18+
/** @var \Magento\Framework\Registry $registry */
19+
$registry =$objectManager->get(\Magento\Framework\Registry::class);
20+
21+
$registry->unregister('isSecureArea');
22+
$registry->register('isSecureArea', true);
23+
24+
try {
25+
/** @var ProductInterface $product */
26+
$product = $productRepository->get('simple-product-tax-none', false, null, true);
27+
$productRepository->delete($product);
28+
} catch (NoSuchEntityException $e) {
29+
// isolation on
30+
}
31+
32+
$registry->unregister('isSecureArea');
33+
$registry->register('isSecureArea', false);

0 commit comments

Comments
 (0)