Skip to content

Commit dc7f483

Browse files
committed
MAGETWO-90562: [Forwardport] Fix transaction level in integration tests framework
1 parent 8820d4a commit dc7f483

File tree

122 files changed

+902
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+902
-213
lines changed

dev/tests/integration/framework/Magento/TestFramework/Db/Adapter/Mysql.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
* See COPYING.txt for license details.
55
*/
66

7+
// @codingStandardsIgnoreFile
8+
79
/**
810
* See \Magento\TestFramework\Db\Adapter\TransactionInterface
911
*/
1012
namespace Magento\TestFramework\Db\Adapter;
1113

12-
class Mysql extends \Magento\Framework\DB\Adapter\Pdo\Mysql implements
13-
\Magento\TestFramework\Db\Adapter\TransactionInterface
14+
class Mysql extends \Magento\Framework\DB\Adapter\Pdo\Mysql implements \Magento\TestFramework\Db\Adapter\TransactionInterface
1415
{
1516
/**
1617
* @var int
@@ -49,14 +50,4 @@ public function rollbackTransparentTransaction()
4950
$this->_levelAdjustment -= 1;
5051
return $this->rollback();
5152
}
52-
53-
/**
54-
* Adjust transaction level with "transparent" counter
55-
*
56-
* @return int
57-
*/
58-
public function getTransactionLevel()
59-
{
60-
return parent::getTransactionLevel() - $this->_levelAdjustment;
61-
}
6253
}

dev/tests/integration/testsuite/Magento/Bundle/Model/Category/ProductIndexerTest.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
use Magento\Catalog\Model\Category;
99

1010
/**
11-
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/fixed_bundle_product.php
12-
* @magentoDataFixture Magento/Catalog/_files/indexer_catalog_category.php
1311
* @magentoAppIsolation enabled
14-
* @magentoDbIsolation enabled
1512
*/
1613
class ProductIndexerTest extends \PHPUnit\Framework\TestCase
1714
{
@@ -57,6 +54,9 @@ protected function setUp()
5754

5855
/**
5956
* @magentoAppArea adminhtml
57+
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/fixed_bundle_product.php
58+
* @magentoDataFixture Magento/Catalog/_files/indexer_catalog_category.php
59+
* @magentoDbIsolation disabled
6060
*/
6161
public function testReindex()
6262
{
@@ -88,6 +88,9 @@ public function testReindex()
8888

8989
/**
9090
* @magentoAppArea adminhtml
91+
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/fixed_bundle_product.php
92+
* @magentoDataFixture Magento/Catalog/_files/indexer_catalog_category.php
93+
* @magentoDbIsolation disabled
9194
*/
9295
public function testCategoryMove()
9396
{
@@ -130,8 +133,10 @@ public function testCategoryMove()
130133
/**
131134
* @magentoAppArea adminhtml
132135
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/dynamic_bundle_product.php
136+
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/fixed_bundle_product.php
133137
* @magentoDataFixture Magento/Catalog/_files/indexer_catalog_category.php
134138
* @depends testReindex
139+
* @magentoDbIsolation disabled
135140
*/
136141
public function testCategoryDelete()
137142
{
@@ -161,7 +166,9 @@ public function testCategoryDelete()
161166
/**
162167
* @magentoAppArea adminhtml
163168
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/dynamic_bundle_product.php
169+
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/fixed_bundle_product.php
164170
* @magentoDataFixture Magento/Catalog/_files/indexer_catalog_category.php
171+
* @magentoDbIsolation disabled
165172
*/
166173
public function testCategoryCreate()
167174
{

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
namespace Magento\Bundle\Model\Product;
88

99
/**
10-
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/dynamic_bundle_product.php
1110
* @magentoAppArea frontend
1211
*/
1312
class DynamicBundlePriceCalculatorTest extends BundlePriceAbstract
@@ -17,6 +16,8 @@ class DynamicBundlePriceCalculatorTest extends BundlePriceAbstract
1716
* @param array $expectedResults
1817
* @dataProvider getTestCases
1918
* @magentoAppIsolation enabled
19+
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/dynamic_bundle_product.php
20+
* @magentoDbIsolation disabled
2021
*/
2122
public function testPriceForDynamicBundle(array $strategyModifiers, array $expectedResults)
2223
{
@@ -56,6 +57,8 @@ public function testPriceForDynamicBundle(array $strategyModifiers, array $expec
5657
* @dataProvider getTestCases
5758
* @magentoAppIsolation enabled
5859
* @magentoConfigFixture current_store catalog/price/scope 1
60+
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/dynamic_bundle_product.php
61+
* @magentoDbIsolation disabled
5962
*/
6063
public function testPriceForDynamicBundleInWebsiteScope(array $strategyModifiers, array $expectedResults)
6164
{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
namespace Magento\Bundle\Model\Product;
88

99
/**
10-
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/dynamic_bundle_product_with_special_price.php
1110
* @magentoAppArea frontend
1211
*/
1312
class DynamicBundleWithSpecialPriceCalculatorTest extends BundlePriceAbstract
@@ -17,6 +16,8 @@ class DynamicBundleWithSpecialPriceCalculatorTest extends BundlePriceAbstract
1716
* @param array $expectedResults
1817
* @dataProvider getTestCases
1918
* @magentoAppIsolation enabled
19+
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/dynamic_bundle_product_with_special_price.php
20+
* @magentoDbIsolation disabled
2021
*/
2122
public function testPriceForDynamicBundle(array $strategyModifiers, array $expectedResults)
2223
{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use \Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory;
1010

1111
/**
12-
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/dynamic_bundle_product.php
1312
* @magentoAppArea frontend
1413
*/
1514
class DynamicBundleWithTierPriceCalculatorTest extends BundlePriceAbstract
@@ -28,6 +27,8 @@ protected function setUp()
2827
* @param array $expectedResults
2928
* @dataProvider getTestCases
3029
* @magentoAppIsolation enabled
30+
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/dynamic_bundle_product.php
31+
* @magentoDbIsolation disabled
3132
*/
3233
public function testPriceForDynamicBundle(array $strategyModifiers, array $expectedResults)
3334
{

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use \Magento\Bundle\Api\Data\LinkInterface;
1010

1111
/**
12-
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/fixed_bundle_product.php
1312
* @magentoAppArea frontend
1413
*/
1514
class FixedBundlePriceCalculatorTest extends BundlePriceAbstract
@@ -19,6 +18,8 @@ class FixedBundlePriceCalculatorTest extends BundlePriceAbstract
1918
* @param array $expectedResults
2019
* @dataProvider getTestCases
2120
* @magentoAppIsolation enabled
21+
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/fixed_bundle_product.php
22+
* @magentoDbIsolation disabled
2223
*/
2324
public function testPriceForFixedBundle(array $strategyModifiers, array $expectedResults)
2425
{
@@ -54,6 +55,8 @@ public function testPriceForFixedBundle(array $strategyModifiers, array $expecte
5455
* @dataProvider getTestCases
5556
* @magentoAppIsolation enabled
5657
* @magentoConfigFixture current_store catalog/price/scope 1
58+
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/fixed_bundle_product.php
59+
* @magentoDbIsolation disabled
5760
*/
5861
public function testPriceForFixedBundleInWebsiteScope(array $strategyModifiers, array $expectedResults)
5962
{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use \Magento\Bundle\Api\Data\LinkInterface;
1010

1111
/**
12-
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/fixed_bundle_product_with_catalog_rule.php
1312
* @magentoAppArea frontend
1413
*/
1514
class FixedBundleWithCatalogPriceRuleCalculatorTest extends BundlePriceAbstract
@@ -19,6 +18,8 @@ class FixedBundleWithCatalogPriceRuleCalculatorTest extends BundlePriceAbstract
1918
* @param array $expectedResults
2019
* @dataProvider getTestCases
2120
* @magentoAppIsolation enabled
21+
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/fixed_bundle_product_with_catalog_rule.php
22+
* @magentoDbIsolation disabled
2223
*/
2324
public function testPriceForFixedBundle(array $strategyModifiers, array $expectedResults)
2425
{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use \Magento\Bundle\Api\Data\LinkInterface;
1010

1111
/**
12-
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/fixed_bundle_product_with_special_price.php
1312
* @magentoAppArea frontend
1413
*/
1514
class FixedBundleWithSpecialPriceCalculatorTest extends BundlePriceAbstract
@@ -19,6 +18,8 @@ class FixedBundleWithSpecialPriceCalculatorTest extends BundlePriceAbstract
1918
* @param array $expectedResults
2019
* @dataProvider getTestCases
2120
* @magentoAppIsolation enabled
21+
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/fixed_bundle_product_with_special_price.php
22+
* @magentoDbIsolation disabled
2223
*/
2324
public function testPriceForFixedBundle(array $strategyModifiers, array $expectedResults)
2425
{

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
/**
1313
* Class FixedBundleWithTierPRiceCalculatorTest
1414
* @package Magento\Bundle\Model\Product
15-
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/fixed_bundle_product.php
1615
* @magentoAppArea frontend
1716
*/
1817
class FixedBundleWithTierPriceCalculatorTest extends BundlePriceAbstract
@@ -31,6 +30,8 @@ protected function setUp()
3130
* @param array $expectedResults
3231
* @dataProvider getTestCases
3332
* @magentoAppIsolation enabled
33+
* @magentoDataFixture Magento/Bundle/_files/PriceCalculator/fixed_bundle_product.php
34+
* @magentoDbIsolation disabled
3435
*/
3536
public function testPriceForFixedBundle(array $strategyModifiers, array $expectedResults)
3637
{

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ protected function setUp()
5151
* @magentoDataFixture Magento/Bundle/_files/product.php
5252
* @covers \Magento\Indexer\Model\Indexer::reindexAll
5353
* @covers \Magento\Bundle\Model\Product\Type::getSearchableData
54+
* @magentoDbIsolation disabled
5455
*/
5556
public function testPrepareProductIndexForBundleProduct()
5657
{
@@ -66,6 +67,7 @@ public function testPrepareProductIndexForBundleProduct()
6667
/**
6768
* @magentoDataFixture Magento/Bundle/_files/product_with_multiple_options.php
6869
* @covers \Magento\Bundle\Model\Product\Type::getOptionsCollection
70+
* @magentoDbIsolation disabled
6971
*/
7072
public function testGetOptionsCollection()
7173
{
@@ -81,6 +83,7 @@ public function testGetOptionsCollection()
8183
/**
8284
* @magentoDataFixture Magento/Bundle/_files/product.php
8385
* @covers \Magento\Bundle\Model\Product\Type::getParentIdsByChild()
86+
* @magentoDbIsolation disabled
8487
*/
8588
public function testGetParentIdsByChild()
8689
{

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public function testIsComposite()
100100
*
101101
* @magentoDataFixture Magento/Bundle/_files/product_with_multiple_options.php
102102
* @magentoDataFixture Magento/Store/_files/second_website_with_two_stores.php
103+
* @magentoDbIsolation disabled
103104
*/
104105
public function testMultipleStores()
105106
{

dev/tests/integration/testsuite/Magento/Bundle/_files/product_with_multiple_options_rollback.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
$registry->unregister('isSecureArea');
1313
$registry->register('isSecureArea', true);
1414

15-
/** @var $product \Magento\Catalog\Model\Product */
16-
$product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Catalog\Model\Product::class);
17-
$product->load(3);
18-
if ($product->getId()) {
19-
$product->delete();
15+
try {
16+
$product = $productRepository->get('bundle-product');
17+
$productRepository->delete($product);
18+
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
19+
//Product already removed
2020
}
2121

2222
$registry->unregister('isSecureArea');

dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*
1111
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
1212
* @magentoAppArea frontend
13+
* @magentoDbIsolation disabled
1314
*/
1415
class ListTest extends \PHPUnit\Framework\TestCase
1516
{

dev/tests/integration/testsuite/Magento/Catalog/Block/Product/NewTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Test class for \Magento\Catalog\Block\Product\New.
1010
*
1111
* @magentoDataFixture Magento/Catalog/_files/products_new.php
12+
* @magentoDbIsolation disabled
1213
*/
1314
class NewTest extends \PHPUnit\Framework\TestCase
1415
{

dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ProductList/RelatedTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Test class for \Magento\Catalog\Block\Product\List\Related.
1010
*
1111
* @magentoDataFixture Magento/Catalog/_files/products_related.php
12+
* @magentoDbIsolation disabled
1213
*/
1314
class RelatedTest extends \PHPUnit\Framework\TestCase
1415
{

dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ProductList/UpsellTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Test class for \Magento\Catalog\Block\Product\List\Upsell.
1010
*
1111
* @magentoDataFixture Magento/Catalog/_files/products_upsell.php
12+
* @magentoDbIsolation disabled
1213
*/
1314
class UpsellTest extends \PHPUnit\Framework\TestCase
1415
{

dev/tests/integration/testsuite/Magento/Catalog/Console/Command/ProductAttributesCleanUpTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public function setUp()
5050
* @magentoDataFixture Magento/Store/_files/website.php
5151
* @magentoDataFixture Magento/Store/_files/fixture_store_with_catalogsearch_index.php
5252
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
53+
* @magentoDbIsolation disabled
5354
*/
5455
public function testExecute()
5556
{

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/Product/Action/AttributeTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class AttributeTest extends \Magento\TestFramework\TestCase\AbstractBackendContr
1414
* @covers \Magento\Catalog\Controller\Adminhtml\Product\Action\Attribute\Save::execute
1515
*
1616
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
17+
* @magentoDbIsolation disabled
1718
*/
1819
public function testSaveActionRedirectsSuccessfully()
1920
{
@@ -51,6 +52,7 @@ public function testSaveActionRedirectsSuccessfully()
5152
* @dataProvider saveActionVisibilityAttrDataProvider
5253
* @param array $attributes
5354
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
55+
* @magentoDbIsolation disabled
5456
*/
5557
public function testSaveActionChangeVisibility($attributes)
5658
{
@@ -93,6 +95,7 @@ public function testSaveActionChangeVisibility($attributes)
9395
*
9496
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
9597
* @magentoDataFixture Magento/Catalog/_files/product_simple_duplicated.php
98+
* @magentoDbIsolation disabled
9699
*/
97100
public function testValidateActionWithMassUpdate($attributes)
98101
{

dev/tests/integration/testsuite/Magento/Catalog/Controller/CategoryTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public function getViewActionDataProvider()
5555
/**
5656
* @dataProvider getViewActionDataProvider
5757
* @magentoDataFixture Magento/CatalogUrlRewrite/_files/categories_with_product_ids.php
58+
* @magentoDbIsolation disabled
5859
*/
5960
public function testViewAction($categoryId, array $expectedHandles, array $expectedContent)
6061
{

dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/CompareTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
/**
1212
* @magentoDataFixture Magento/Catalog/controllers/_files/products.php
1313
*
14+
* @magentoDbIsolation disabled
15+
*
1416
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1517
*/
1618
class CompareTest extends \Magento\TestFramework\TestCase\AbstractController

dev/tests/integration/testsuite/Magento/Catalog/Controller/Product/ViewTest.php

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

88
/**
99
* @magentoDataFixture Magento/Catalog/controllers/_files/products.php
10+
* @magentoDbIsolation disabled
1011
*/
1112
class ViewTest extends \Magento\TestFramework\TestCase\AbstractController
1213
{

dev/tests/integration/testsuite/Magento/Catalog/Cron/DeleteOutdatedPriceValuesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function setUp()
4949
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
5050
* @magentoDataFixture Magento/Store/_files/second_website_with_two_stores.php
5151
* @magentoConfigFixture current_store catalog/price/scope 1
52-
* @magentoDbIsolation enabled
52+
* @magentoDbIsolation disabled
5353
* @magentoAppIsolation enabled
5454
*/
5555
public function testExecute()

dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/CompareTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ protected function setUp()
2525

2626
/**
2727
* @magentoDataFixture Magento/Catalog/_files/multiple_products.php
28+
* @magentoDbIsolation disabled
2829
*/
2930
public function testGetListUrl()
3031
{
@@ -97,6 +98,7 @@ public function testGetItemCollection()
9798
* getItemCount()
9899
* hasItems()
99100
* @magentoDataFixture Magento/Catalog/_files/multiple_products.php
101+
* @magentoDbIsolation disabled
100102
*/
101103
public function testCalculate()
102104
{

dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Category/ProductTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* @magentoDataFixture Magento/Catalog/_files/indexer_catalog_category.php
1212
* @magentoDataFixture Magento/Catalog/_files/indexer_catalog_products.php
13-
* @magentoDbIsolation enabled
13+
* @magentoDbIsolation disabled
1414
* @magentoAppIsolation enabled
1515
*/
1616
class ProductTest extends \PHPUnit\Framework\TestCase

0 commit comments

Comments
 (0)