Skip to content

Commit 665aad5

Browse files
committed
#23279: Integration test for unsubscribing from 'Back in stock notification'
Added customer_unsubscribe_stock_rollback.php for cleaning entries
1 parent 36c00d2 commit 665aad5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
use Magento\Catalog\Api\ProductRepositoryInterface;
8+
use Magento\ProductAlert\Model\ResourceModel\Stock;
9+
use Magento\TestFramework\Helper\Bootstrap;
10+
11+
$objectManager = Bootstrap::getObjectManager();
12+
$resource = $objectManager->get(Stock::class);
13+
14+
$productRepository = $objectManager->create(ProductRepositoryInterface::class);
15+
$productId = $productRepository->get('simple-out-of-stock')->getId();
16+
17+
$resource->getConnection()->delete(
18+
$resource->getMainTable(),
19+
'product_id = ' . $productId
20+
);

0 commit comments

Comments
 (0)