Skip to content

Commit

Permalink
#23279: Integration test for unsubscribing from 'Back in stock notifi…
Browse files Browse the repository at this point in the history
…cation'

Added customer_unsubscribe_stock_rollback.php for cleaning entries
  • Loading branch information
yuriichayka committed Aug 27, 2019
1 parent 36c00d2 commit 665aad5
Showing 1 changed file with 20 additions and 0 deletions.
@@ -0,0 +1,20 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

use Magento\Catalog\Api\ProductRepositoryInterface;
use Magento\ProductAlert\Model\ResourceModel\Stock;
use Magento\TestFramework\Helper\Bootstrap;

$objectManager = Bootstrap::getObjectManager();
$resource = $objectManager->get(Stock::class);

$productRepository = $objectManager->create(ProductRepositoryInterface::class);
$productId = $productRepository->get('simple-out-of-stock')->getId();

$resource->getConnection()->delete(
$resource->getMainTable(),
'product_id = ' . $productId
);

0 comments on commit 665aad5

Please sign in to comment.