Skip to content

Commit 6145341

Browse files
committed
MAGETWO-92402: Write tests
1 parent d7af884 commit 6145341

File tree

8 files changed

+39
-2
lines changed

8 files changed

+39
-2
lines changed

dev/tests/integration/testsuite/Magento/Bundle/Block/Catalog/Product/View/Type/BundleTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
/**
99
* @magentoDataFixture Magento/Bundle/_files/product.php
10+
* @magentoDbIsolation disabled
1011
* @magentoAppArea frontend
1112
*/
1213
class BundleTest extends \PHPUnit\Framework\TestCase

dev/tests/integration/testsuite/Magento/Bundle/Controller/ProductTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class ProductTest extends \Magento\TestFramework\TestCase\AbstractController
1313
{
1414
/**
1515
* @magentoDataFixture Magento/Bundle/_files/product.php
16+
* @magentoDbIsolation disabled
1617
*/
1718
public function testViewAction()
1819
{

dev/tests/integration/testsuite/Magento/Bundle/Model/Product/OptionListTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ protected function setUp()
2828

2929
/**
3030
* @magentoDataFixture Magento/Bundle/_files/product.php
31+
* @magentoDbIsolation disabled
3132
*/
3233
public function testGetItems()
3334
{

dev/tests/integration/testsuite/Magento/Bundle/Model/ProductTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ public function testMultipleStores()
138138
* @param bool $isSalable
139139
* @magentoAppIsolation enabled
140140
* @magentoDataFixture Magento/Bundle/_files/product.php
141+
* @magentoDbIsolation disabled
141142
* @dataProvider stockConfigDataProvider
142143
* @covers \Magento\Catalog\Model\Product::isSalable
143144
*/

dev/tests/integration/testsuite/Magento/BundleImportExport/Model/Export/RowCustomizerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ protected function setUp()
3030

3131
/**
3232
* @magentoDataFixture Magento/Bundle/_files/product.php
33+
* @magentoDbIsolation disabled
3334
*/
3435
public function testPrepareData()
3536
{

dev/tests/integration/testsuite/Magento/CatalogInventory/Model/Quote/Item/QuantityValidatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected function setUp()
8383

8484
/**
8585
* @magentoDataFixture Magento/Checkout/_files/quote_with_bundle_product.php
86-
* @magentoDbIsolation enabled
86+
* @magentoDbIsolation disabled
8787
* @magentoAppIsolation enabled
8888
*/
8989
public function testQuoteWithOptions()
@@ -108,7 +108,7 @@ public function testQuoteWithOptions()
108108

109109
/**
110110
* @magentoDataFixture Magento/Checkout/_files/quote_with_bundle_product.php
111-
* @magentoDbIsolation enabled
111+
* @magentoDbIsolation disabled
112112
* @magentoAppIsolation enabled
113113
*/
114114
public function testQuoteWithOptionsWithErrors()

dev/tests/integration/testsuite/Magento/Checkout/Controller/CartTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public function testConfigureActionWithSimpleProductAndCustomOption()
108108
* Test for \Magento\Checkout\Controller\Cart::configureAction() with bundle product
109109
*
110110
* @magentoDataFixture Magento/Checkout/_files/quote_with_bundle_product.php
111+
* @magentoDbIsolation disabled
111112
*/
112113
public function testConfigureActionWithBundleProduct()
113114
{
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
/*
8+
* Since the bundle product creation GUI doesn't allow to choose values for bundled products' custom options,
9+
* bundled items should not contain products with required custom options.
10+
* However, if to create such a bundle product, it will be always out of stock.
11+
*/
12+
require __DIR__ . '/../../../Magento/Catalog/_files/products_rollback.php';
13+
14+
/** @var \Magento\Framework\Registry $registry */
15+
$registry = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(\Magento\Framework\Registry::class);
16+
$registry->unregister('isSecureArea');
17+
$registry->register('isSecureArea', true);
18+
19+
$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
20+
->get(\Magento\Catalog\Api\ProductRepositoryInterface::class);
21+
try {
22+
$product = $productRepository->get('bundle-product', false, null, true);
23+
$productRepository->delete($product);
24+
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
25+
//Product already removed
26+
}
27+
28+
//TODO: remove created cart info
29+
30+
$registry->unregister('isSecureArea');
31+
$registry->register('isSecureArea', false);

0 commit comments

Comments
 (0)