diff --git a/app/code/Magento/Catalog/Model/ProductRepository.php b/app/code/Magento/Catalog/Model/ProductRepository.php
index 76d048ebf2e98..82ddedc131611 100644
--- a/app/code/Magento/Catalog/Model/ProductRepository.php
+++ b/app/code/Magento/Catalog/Model/ProductRepository.php
@@ -512,6 +512,8 @@ public function save(\Magento\Catalog\Api\Data\ProductInterface $product, $saveO
if ($tierPrices !== null) {
$product->setData('tier_price', $tierPrices);
}
+ unset($this->instances[$product->getSku()]);
+ unset($this->instancesById[$product->getId()]);
$this->resourceModel->save($product);
} catch (\Magento\Eav\Model\Entity\Attribute\Exception $exception) {
throw \Magento\Framework\Exception\InputException::invalidFieldValue(
@@ -535,6 +537,8 @@ public function delete(\Magento\Catalog\Api\Data\ProductInterface $product)
$sku = $product->getSku();
$productId = $product->getId();
try {
+ unset($this->instances[$product->getSku()]);
+ unset($this->instancesById[$product->getId()]);
$this->resourceModel->delete($product);
} catch (\Exception $e) {
throw new \Magento\Framework\Exception\StateException(
diff --git a/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php b/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php
index cb4fe91cae552..56683ff6d1edf 100644
--- a/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php
+++ b/app/code/Magento/Catalog/Test/Unit/Model/ProductRepositoryTest.php
@@ -541,7 +541,7 @@ public function testSaveException()
->willReturn(true);
$this->resourceModelMock->expects($this->once())->method('save')->with($this->productMock)
->willThrowException(new \Magento\Eav\Model\Entity\Attribute\Exception(__('123')));
- $this->productMock->expects($this->never())->method('getId');
+ $this->productMock->expects($this->once())->method('getId')->willReturn(null);
$this->extensibleDataObjectConverterMock
->expects($this->once())
->method('toNestedArray')
@@ -576,7 +576,8 @@ public function testSaveInvalidProductException()
public function testDelete()
{
- $this->productMock->expects($this->once())->method('getSku')->willReturn('product-42');
+ $this->productMock->expects($this->exactly(2))->method('getSku')->willReturn('product-42');
+ $this->productMock->expects($this->exactly(2))->method('getId')->willReturn(42);
$this->resourceModelMock->expects($this->once())->method('delete')->with($this->productMock)
->willReturn(true);
$this->assertTrue($this->model->delete($this->productMock));
@@ -588,7 +589,8 @@ public function testDelete()
*/
public function testDeleteException()
{
- $this->productMock->expects($this->once())->method('getSku')->willReturn('product-42');
+ $this->productMock->expects($this->exactly(2))->method('getSku')->willReturn('product-42');
+ $this->productMock->expects($this->exactly(2))->method('getId')->willReturn(42);
$this->resourceModelMock->expects($this->once())->method('delete')->with($this->productMock)
->willThrowException(new \Exception());
$this->model->delete($this->productMock);
diff --git a/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php b/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php
index d07b3defedeb5..bc1742a622b3d 100644
--- a/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php
+++ b/app/code/Magento/CatalogRule/Model/ResourceModel/Rule.php
@@ -250,16 +250,8 @@ public function save(\Magento\Framework\Model\AbstractModel $object)
if ($object->isDeleted()) {
return $this->delete($object);
}
-
$this->beginTransaction();
-
try {
- if (!$this->isModified($object)) {
- $this->processNotModifiedSave($object);
- $this->commit();
- $object->setHasDataChanges(false);
- return $this;
- }
$object->validateBeforeSave();
$object->beforeSave();
if ($object->isSaveAllowed()) {
diff --git a/app/code/Magento/Cms/Model/ResourceModel/Block.php b/app/code/Magento/Cms/Model/ResourceModel/Block.php
index c0a2ec71cba82..c4c8886c2c8d3 100644
--- a/app/code/Magento/Cms/Model/ResourceModel/Block.php
+++ b/app/code/Magento/Cms/Model/ResourceModel/Block.php
@@ -236,16 +236,8 @@ public function save(AbstractModel $object)
if ($object->isDeleted()) {
return $this->delete($object);
}
-
$this->beginTransaction();
-
try {
- if (!$this->isModified($object)) {
- $this->processNotModifiedSave($object);
- $this->commit();
- $object->setHasDataChanges(false);
- return $this;
- }
$object->validateBeforeSave();
$object->beforeSave();
if ($object->isSaveAllowed()) {
diff --git a/app/code/Magento/Cms/Model/ResourceModel/Page.php b/app/code/Magento/Cms/Model/ResourceModel/Page.php
index f18f2f6f32070..f6beb3edc8b4e 100644
--- a/app/code/Magento/Cms/Model/ResourceModel/Page.php
+++ b/app/code/Magento/Cms/Model/ResourceModel/Page.php
@@ -386,16 +386,8 @@ public function save(AbstractModel $object)
if ($object->isDeleted()) {
return $this->delete($object);
}
-
$this->beginTransaction();
-
try {
- if (!$this->isModified($object)) {
- $this->processNotModifiedSave($object);
- $this->commit();
- $object->setHasDataChanges(false);
- return $this;
- }
$object->validateBeforeSave();
$object->beforeSave();
if ($object->isSaveAllowed()) {
diff --git a/app/code/Magento/Customer/Model/Plugin/CustomerRepository/TransactionWrapper.php b/app/code/Magento/Customer/Model/Plugin/CustomerRepository/TransactionWrapper.php
new file mode 100644
index 0000000000000..4820ff56d13ea
--- /dev/null
+++ b/app/code/Magento/Customer/Model/Plugin/CustomerRepository/TransactionWrapper.php
@@ -0,0 +1,52 @@
+resourceModel = $resourceModel;
+ }
+
+ /**
+ * @param \Magento\Customer\Api\CustomerRepositoryInterface $subject
+ * @param callable $proceed
+ * @param \Magento\Customer\Api\Data\CustomerInterface $customer
+ * @param string $passwordHash
+ * @return \Magento\Customer\Api\Data\CustomerInterface
+ * @throws \Exception
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ */
+ public function aroundSave(
+ \Magento\Customer\Api\CustomerRepositoryInterface $subject,
+ \Closure $proceed,
+ \Magento\Customer\Api\Data\CustomerInterface $customer,
+ $passwordHash = null
+ ) {
+ $this->resourceModel->beginTransaction();
+ try {
+ /** @var $result \Magento\Customer\Api\Data\CustomerInterface */
+ $result = $proceed($customer, $passwordHash);
+ $this->resourceModel->commit();
+ return $result;
+ } catch (\Exception $e) {
+ $this->resourceModel->rollBack();
+ throw $e;
+ }
+ }
+}
diff --git a/app/code/Magento/Customer/Test/Unit/Model/Plugin/CustomerRepository/TransactionWrapperTest.php b/app/code/Magento/Customer/Test/Unit/Model/Plugin/CustomerRepository/TransactionWrapperTest.php
new file mode 100644
index 0000000000000..314ea794b4993
--- /dev/null
+++ b/app/code/Magento/Customer/Test/Unit/Model/Plugin/CustomerRepository/TransactionWrapperTest.php
@@ -0,0 +1,90 @@
+resourceMock = $this->getMock('Magento\Customer\Model\ResourceModel\Customer', [], [], '', false);
+ $this->subjectMock = $this->getMock('Magento\Customer\Api\CustomerRepositoryInterface', [], [], '', false);
+ $this->customerMock = $this->getMock('Magento\Customer\Api\Data\CustomerInterface', [], [], '', false);
+ $customerMock = $this->customerMock;
+ $this->closureMock = function () use ($customerMock) {
+ return $customerMock;
+ };
+ $this->rollbackClosureMock = function () use ($customerMock) {
+ throw new \Exception(self::ERROR_MSG);
+ };
+
+ $this->model = new \Magento\Customer\Model\Plugin\CustomerRepository\TransactionWrapper($this->resourceMock);
+ }
+
+ public function testAroundSaveCommit()
+ {
+ $this->resourceMock->expects($this->once())->method('beginTransaction');
+ $this->resourceMock->expects($this->once())->method('commit');
+
+ $this->assertEquals(
+ $this->customerMock,
+ $this->model->aroundSave($this->subjectMock, $this->closureMock, $this->customerMock, $this->passwordHash)
+ );
+ }
+
+ /**
+ * @expectedException \Exception
+ * @expectedExceptionMessage error occurred
+ */
+ public function testAroundSaveRollBack()
+ {
+ $this->resourceMock->expects($this->once())->method('beginTransaction');
+ $this->resourceMock->expects($this->once())->method('rollBack');
+
+ $this->model->aroundSave(
+ $this->subjectMock,
+ $this->rollbackClosureMock,
+ $this->customerMock,
+ $this->passwordHash
+ );
+ }
+}
diff --git a/app/code/Magento/Customer/etc/di.xml b/app/code/Magento/Customer/etc/di.xml
index 03747e91db659..3ebf411e1a894 100644
--- a/app/code/Magento/Customer/etc/di.xml
+++ b/app/code/Magento/Customer/etc/di.xml
@@ -205,26 +205,6 @@
BillingAddressExpression
-
-
- LastVisitAtSubSelect
-
-
-
-
- customer_visitor
- last_visit_at
-
- -
-
- e
- - entity_id
-
-
-
- - last_visit_at
-
-
-
e
@@ -319,4 +299,7 @@
+
+
+
diff --git a/app/code/Magento/Customer/etc/indexer.xml b/app/code/Magento/Customer/etc/indexer.xml
index 11471b4f6eb09..ccc24f0d6af9b 100644
--- a/app/code/Magento/Customer/etc/indexer.xml
+++ b/app/code/Magento/Customer/etc/indexer.xml
@@ -23,7 +23,6 @@
-
diff --git a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml
index 67bab36c9ccde..f684b89a329ca 100644
--- a/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml
+++ b/app/code/Magento/Customer/view/adminhtml/ui_component/customer_listing.xml
@@ -257,18 +257,6 @@
-
-
- -
-
- Magento_Ui/js/grid/columns/date
- - dateRange
- - false
- - date
- - Last Logged In
- - 120
-
-
-
-
diff --git a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js
index 70db1def12ac9..d0178d96210d7 100644
--- a/app/code/Magento/Customer/view/frontend/web/js/customer-data.js
+++ b/app/code/Magento/Customer/view/frontend/web/js/customer-data.js
@@ -93,10 +93,17 @@ define([
* @return {*}
*/
ko.extenders.disposableCustomerData = function (target, sectionName) {
- storage.remove(sectionName);
+ var sectionDataIds, newSectionDataIds = {};
target.subscribe(function () {
setTimeout(function () {
storage.remove(sectionName);
+ sectionDataIds = $.cookieStorage.get('section_data_ids') || {};
+ _.each(sectionDataIds, function (data, name) {
+ if (name != sectionName) {
+ newSectionDataIds[name] = data;
+ }
+ });
+ $.cookieStorage.set('section_data_ids', newSectionDataIds);
}, 3000);
});
@@ -166,7 +173,9 @@ define([
remove: function (sections) {
_.each(sections, function (sectionName) {
storage.remove(sectionName);
- storageInvalidation.set(sectionName, true);
+ if (!sectionConfig.isClientSideSection(sectionName)) {
+ storageInvalidation.set(sectionName, true);
+ }
});
}
};
@@ -202,7 +211,7 @@ define([
if (!_.isEmpty(privateContent)) {
countryData = this.get('directory-data');
if (_.isEmpty(countryData())) {
- countryData(customerData.reload(['directory-data'], false));
+ customerData.reload(['directory-data'], false);
}
}
},
@@ -304,7 +313,9 @@ define([
// Invalidate section in cookie (increase version of section with 1000)
_.each(sectionsNamesForInvalidation, function (sectionName) {
- sectionDataIds[sectionName] += 1000;
+ if (!sectionConfig.isClientSideSection(sectionName)) {
+ sectionDataIds[sectionName] += 1000;
+ }
});
$.cookieStorage.set('section_data_ids', sectionDataIds);
},
diff --git a/app/code/Magento/Customer/view/frontend/web/js/section-config.js b/app/code/Magento/Customer/view/frontend/web/js/section-config.js
index 35b05604821fa..f04b6e2597324 100644
--- a/app/code/Magento/Customer/view/frontend/web/js/section-config.js
+++ b/app/code/Magento/Customer/view/frontend/web/js/section-config.js
@@ -34,12 +34,16 @@ define(['underscore'], function (_) {
},
filterClientSideSections: function (sections) {
- if (_.isArray(sections)) {
+ if (Array.isArray(sections)) {
return _.difference(sections, clientSideSections);
}
return sections;
},
+ isClientSideSection: function (sectionName) {
+ return _.contains(clientSideSections, sectionName);
+ },
+
'Magento_Customer/js/section-config': function(options) {
baseUrls = options.baseUrls;
sections = options.sections;
diff --git a/app/code/Magento/SalesRule/Model/ResourceModel/Rule.php b/app/code/Magento/SalesRule/Model/ResourceModel/Rule.php
index 122bee0b2c38a..0581cdba57d21 100644
--- a/app/code/Magento/SalesRule/Model/ResourceModel/Rule.php
+++ b/app/code/Magento/SalesRule/Model/ResourceModel/Rule.php
@@ -373,16 +373,8 @@ public function save(\Magento\Framework\Model\AbstractModel $object)
if ($object->isDeleted()) {
return $this->delete($object);
}
-
$this->beginTransaction();
-
try {
- if (!$this->isModified($object)) {
- $this->processNotModifiedSave($object);
- $this->commit();
- $object->setHasDataChanges(false);
- return $this;
- }
$object->validateBeforeSave();
$object->beforeSave();
if ($object->isSaveAllowed()) {
diff --git a/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php b/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php
index 36af26d2dedbe..93de33d765fdd 100644
--- a/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php
+++ b/dev/tests/api-functional/testsuite/Magento/Customer/Api/CustomerRepositoryTest.php
@@ -6,12 +6,14 @@
namespace Magento\Customer\Api;
use Magento\Customer\Api\Data\CustomerInterface as Customer;
+use Magento\Customer\Api\Data\AddressInterface as Address;
use Magento\Framework\Api\SortOrder;
use Magento\Framework\Exception\InputException;
use Magento\TestFramework\Helper\Bootstrap;
use Magento\TestFramework\Helper\Customer as CustomerHelper;
use Magento\TestFramework\TestCase\WebapiAbstract;
use Magento\Framework\Webapi\Exception as HTTPExceptionCodes;
+use Magento\Framework\Exception\NoSuchEntityException;
/**
* Test class for Magento\Customer\Api\CustomerRepositoryInterface
@@ -346,6 +348,83 @@ public function testUpdateCustomerException()
}
}
+ /**
+ * Test creating a customer with absent required address fields
+ */
+ public function testCreateCustomerWithoutAddressRequiresException()
+ {
+ $customerDataArray = $this->dataObjectProcessor->buildOutputDataArray(
+ $this->customerHelper->createSampleCustomerDataObject(),
+ '\Magento\Customer\Api\Data\CustomerInterface'
+ );
+
+ foreach ($customerDataArray[Customer::KEY_ADDRESSES] as & $address) {
+ $address[Address::FIRSTNAME] = null;
+ }
+
+ $serviceInfo = [
+ 'rest' => [
+ 'resourcePath' => self::RESOURCE_PATH,
+ 'httpMethod' => \Magento\Framework\Webapi\Rest\Request::HTTP_METHOD_POST,
+ ],
+ 'soap' => [
+ 'service' => self::SERVICE_NAME,
+ 'serviceVersion' => self::SERVICE_VERSION,
+ 'operation' => self::SERVICE_NAME . 'Save',
+ ],
+ ];
+ $requestData = ['customer' => $customerDataArray];
+ try {
+ $this->_webApiCall($serviceInfo, $requestData);
+ $this->fail('Expected exception did not occur.');
+ } catch (\Exception $e) {
+ if (TESTS_WEB_API_ADAPTER == self::ADAPTER_SOAP) {
+ $expectedException = new InputException();
+ $expectedException->addError(
+ __(
+ InputException::REQUIRED_FIELD,
+ ['fieldName' => Address::FIRSTNAME]
+ )
+ );
+ $this->assertInstanceOf('SoapFault', $e);
+ $this->checkSoapFault(
+ $e,
+ $expectedException->getRawMessage(),
+ 'env:Sender',
+ $expectedException->getParameters() // expected error parameters
+ );
+ } else {
+ $this->assertEquals(HTTPExceptionCodes::HTTP_BAD_REQUEST, $e->getCode());
+ $exceptionData = $this->processRestExceptionResult($e);
+ $expectedExceptionData = [
+ 'message' => InputException::REQUIRED_FIELD,
+ 'parameters' => ['fieldName' => Address::FIRSTNAME],
+ ];
+ $this->assertEquals($expectedExceptionData, $exceptionData);
+ }
+ }
+
+ try {
+ $this->customerRegistry->retrieveByEmail(
+ $customerDataArray[Customer::EMAIL],
+ $customerDataArray[Customer::WEBSITE_ID]
+ );
+ $this->fail('An expected NoSuchEntityException was not thrown.');
+ } catch (NoSuchEntityException $e) {
+ $exception = NoSuchEntityException::doubleField(
+ 'email',
+ $customerDataArray[Customer::EMAIL],
+ 'websiteId',
+ $customerDataArray[Customer::WEBSITE_ID]
+ );
+ $this->assertEquals(
+ $exception->getMessage(),
+ $e->getMessage(),
+ 'Exception message does not match expected message.'
+ );
+ }
+ }
+
/**
* Test with a single filter
*/
diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/AdvancedPricing.php b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/AdvancedPricing.php
index a2ae2c7ba9ced..e9b2568d13ab4 100644
--- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/AdvancedPricing.php
+++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Section/AdvancedPricing.php
@@ -98,7 +98,7 @@ public function getFieldsData($fields = null, SimpleElement $element = null)
*/
public function getTierPriceForm(SimpleElement $element = null)
{
- $element = $element ?: $this->_rootElement->find($this->tierPrice);
+ $element = $element ?: $this->browser->find($this->advancedPricingRootElement);
return $this->blockFactory->create(
'Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Section\AdvancedPricing\OptionTier',
['element' => $element]
diff --git a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Section/RuleInformation.php b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Section/RuleInformation.php
index d56cbf0b0b7bd..93faa37225865 100644
--- a/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Section/RuleInformation.php
+++ b/dev/tests/functional/tests/app/Magento/CatalogRule/Test/Block/Adminhtml/Promo/Catalog/Edit/Section/RuleInformation.php
@@ -18,7 +18,7 @@ class RuleInformation extends Section
*
* @var string
*/
- protected $customerGroup = '#rule_customer_group_ids';
+ protected $customerGroup = '[name=customer_group_ids]';
/**
* Check whether Customer Group is visible.
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCartPriceRuleForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCartPriceRuleForm.php
index 5f49cbee1e5a4..30fff8c5bdb15 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCartPriceRuleForm.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCartPriceRuleForm.php
@@ -8,7 +8,7 @@
use Magento\Customer\Test\Fixture\CustomerGroup;
use Magento\Mtf\Constraint\AbstractConstraint;
-use Magento\SalesRule\Test\Block\Adminhtml\Promo\Quote\Edit\Tab\RuleInformation;
+use Magento\SalesRule\Test\Block\Adminhtml\Promo\Quote\Edit\Section\RuleInformation;
use Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteIndex;
use Magento\SalesRule\Test\Page\Adminhtml\PromoQuoteNew;
@@ -32,10 +32,10 @@ public function processAssert(
) {
$promoQuoteIndex->open();
$promoQuoteIndex->getGridPageActions()->addNew();
- $promoQuoteNew->getSalesRuleForm()->openTab('rule_information');
+ $promoQuoteNew->getSalesRuleForm()->openSection('rule_information');
/** @var RuleInformation $ruleInformationTab */
- $ruleInformationTab = $promoQuoteNew->getSalesRuleForm()->getTab('rule_information');
+ $ruleInformationTab = $promoQuoteNew->getSalesRuleForm()->getSection('rule_information');
\PHPUnit_Framework_Assert::assertTrue(
$ruleInformationTab->isVisibleCustomerGroup($customerGroup),
"Customer group {$customerGroup->getCustomerGroupCode()} not in cart price rule page."
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCatalogPriceRuleForm.php b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCatalogPriceRuleForm.php
index 74a176c341203..236c118811e4c 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCatalogPriceRuleForm.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/Constraint/AssertCustomerGroupOnCatalogPriceRuleForm.php
@@ -32,7 +32,7 @@ public function processAssert(
) {
$catalogRuleIndex->open();
$catalogRuleIndex->getGridPageActions()->addNew();
- $catalogRuleNew->getEditForm()->openTab('rule_information');
+ $catalogRuleNew->getEditForm()->openSection('rule_information');
/** @var RuleInformation $ruleInformationSection */
$ruleInformationSection = $catalogRuleNew->getEditForm()->getSection('rule_information');
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php
index b68c1850d0c5f..697829712742e 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/MassDeleteCustomerBackendEntityTest.php
@@ -74,6 +74,8 @@ public function __inject(
$this->fixtureFactory = $fixtureFactory;
$this->customerIndexPage = $customerIndexPage;
$this->customerIndexEditPage = $customerIndexEditPage;
+ $customerIndexPage->open();
+ $customerIndexPage->getCustomerGridBlock()->massaction([], 'Delete', true, 'Select All');
}
/**
diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit/Section/RuleInformation.php b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit/Section/RuleInformation.php
index 911c33f10dc4b..71fee22605bdc 100644
--- a/dev/tests/functional/tests/app/Magento/SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit/Section/RuleInformation.php
+++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/Block/Adminhtml/Promo/Quote/Edit/Section/RuleInformation.php
@@ -20,7 +20,7 @@ class RuleInformation extends Section
*
* @var string
*/
- protected $customerGroup = '#rule_customer_group_ids';
+ protected $customerGroup = '[name=customer_group_ids]';
/**
* Get data of section.
diff --git a/dev/tests/integration/testsuite/Magento/Bundle/_files/product_rollback.php b/dev/tests/integration/testsuite/Magento/Bundle/_files/product_rollback.php
index d0c016d63ca1b..100c5e78f5aa3 100644
--- a/dev/tests/integration/testsuite/Magento/Bundle/_files/product_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Bundle/_files/product_rollback.php
@@ -19,7 +19,7 @@
$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->get('Magento\Catalog\Api\ProductRepositoryInterface');
try {
- $product = $productRepository->get('bundle-product');
+ $product = $productRepository->get('bundle-product', false, null, true);
$productRepository->delete($product);
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
//Product already removed
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_rollback.php
index e114f71d09d0c..b3b16b0788274 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/categories_rollback.php
@@ -18,7 +18,7 @@
foreach ($productsToDelete as $sku) {
try {
- $product = $productRepository->get($sku);
+ $product = $productRepository->get($sku, false, null, true);
$productRepository->delete($product);
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
//Product already removed
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/indexer_catalog_category_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/indexer_catalog_category_rollback.php
index c9209b78f61ae..ddd77a554fc57 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/indexer_catalog_category_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/indexer_catalog_category_rollback.php
@@ -18,7 +18,7 @@
foreach (['simple 01', 'simple 02', 'simple 03'] as $sku) {
try {
- $product = $productRepository->get($sku);
+ $product = $productRepository->get($sku, false, null, true);
$productRepository->delete($product);
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
//Product already removed
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/multiple_products_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiple_products_rollback.php
index e02133229b434..212c8e53200a3 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/multiple_products_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/multiple_products_rollback.php
@@ -17,7 +17,7 @@
foreach (['simple1', 'simple2', 'simple3'] as $sku) {
try {
- $product = $productRepository->get($sku);
+ $product = $productRepository->get($sku, false, null, true);
$productRepository->delete($product);
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
//Product already removed
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/price_row_fixture_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/price_row_fixture_rollback.php
index 6e025caeeb270..befd8ca541756 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/price_row_fixture_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/price_row_fixture_rollback.php
@@ -17,7 +17,7 @@
'Magento\Catalog\Model\ProductRepository'
);
try {
- $product = $repository->get('simple');
+ $product = $repository->get('simple', false, null, true);
$product->delete();
} catch (NoSuchEntityException $e) {
//Entity already deleted
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_associated_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_associated_rollback.php
index 613c72fb5fc89..0a80717c990e3 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_associated_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_associated_rollback.php
@@ -15,7 +15,7 @@
'Magento\Catalog\Model\ProductRepository'
);
try {
- $product = $repository->get('simple');
+ $product = $repository->get('simple', false, null, true);
$product->delete();
} catch (NoSuchEntityException $e) {
//Entity already deleted
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_group_prices_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_group_prices_rollback.php
index 387509efd7d63..0621f94fe9adc 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_group_prices_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_group_prices_rollback.php
@@ -14,7 +14,7 @@
'Magento\Catalog\Model\ProductRepository'
);
try {
- $product = $repository->get('simple');
+ $product = $repository->get('simple', false, null, true);
$product->delete();
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
//Entity already deleted
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_duplicated_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_duplicated_rollback.php
index 50f977ff615b1..0763e4d406b53 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_duplicated_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_duplicated_rollback.php
@@ -16,7 +16,7 @@
$productRepository = $objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface');
try {
- $product = $productRepository->get('simple-1');
+ $product = $productRepository->get('simple-1', false, null, true);
$productRepository->delete($product);
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
//Product already removed
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_multistore_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_multistore_rollback.php
index addd42ebfc706..0b4c6a015fe36 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_multistore_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_multistore_rollback.php
@@ -14,7 +14,7 @@
'Magento\Catalog\Model\ProductRepository'
);
try {
- $product = $repository->get('simple');
+ $product = $repository->get('simple', false, null, true);
$product->delete();
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
//Entity already deleted
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_rollback.php
index 493334cc6fce6..f733075176b17 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_simple_rollback.php
@@ -17,7 +17,7 @@
$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->get('Magento\Catalog\Api\ProductRepositoryInterface');
try {
- $product = $productRepository->get('simple');
+ $product = $productRepository->get('simple', false, null, true);
$productRepository->delete($product);
} catch (NoSuchEntityException $e) {
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_rollback.php
index 98732a95a1307..04037eaaae785 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_virtual_rollback.php
@@ -15,7 +15,7 @@
->create('Magento\Catalog\Api\ProductRepositoryInterface');
try {
- $product = $productRepository->get('virtual-product');
+ $product = $productRepository->get('virtual-product', false, null, true);
$productRepository->delete($product);
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
//Product already removed
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_dropdown_option_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_dropdown_option_rollback.php
index db482d165660b..6ecaeab5f89f3 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_dropdown_option_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_dropdown_option_rollback.php
@@ -15,7 +15,7 @@
$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->create('Magento\Catalog\Api\ProductRepositoryInterface');
try {
- $product = $productRepository->get('simple_dropdown_option');
+ $product = $productRepository->get('simple_dropdown_option', false, null, true);
$product->delete();
} catch (NoSuchEntityException $e) {
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_options_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_options_rollback.php
index eddc5632f7c3b..15f422899a3fd 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_options_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_with_options_rollback.php
@@ -14,7 +14,7 @@
'Magento\Catalog\Model\ProductRepository'
);
try {
- $product = $repository->get('simple');
+ $product = $repository->get('simple', false, null, true);
$product->delete();
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
//Entity already deleted
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_without_options_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_without_options_rollback.php
index eddc5632f7c3b..15f422899a3fd 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/product_without_options_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/product_without_options_rollback.php
@@ -14,7 +14,7 @@
'Magento\Catalog\Model\ProductRepository'
);
try {
- $product = $repository->get('simple');
+ $product = $repository->get('simple', false, null, true);
$product->delete();
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
//Entity already deleted
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_crosssell_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_crosssell_rollback.php
index 37705cf6d7569..8a4e66cdb2136 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_crosssell_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_crosssell_rollback.php
@@ -16,14 +16,14 @@
$productRepository = $objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface');
try {
- $firstProduct = $productRepository->get('simple');
+ $firstProduct = $productRepository->get('simple', false, null, true);
$firstProduct->delete();
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
//Product already removed
}
try {
- $secondProduct = $productRepository->get('simple_with_cross');
+ $secondProduct = $productRepository->get('simple_with_cross', false, null, true);
$secondProduct->delete();
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
//Product already removed
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_new_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_new_rollback.php
index cce6ceee9bbeb..a368c71984e1f 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_new_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_new_rollback.php
@@ -16,7 +16,7 @@
$productRepository = $objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface');
try {
- $firstProduct = $productRepository->get('simple');
+ $firstProduct = $productRepository->get('simple', false, null, true);
$productRepository->delete($firstProduct);
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
//Product already removed
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_related_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_related_rollback.php
index a58176f847579..cc3b5ba4b627e 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_related_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_related_rollback.php
@@ -16,14 +16,14 @@
$productRepository = $objectManager->create('Magento\Catalog\Api\ProductRepositoryInterface');
try {
- $firstProduct = $productRepository->get('simple');
+ $firstProduct = $productRepository->get('simple', false, null, true);
$productRepository->delete($firstProduct);
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
//Product already removed
}
try {
- $secondProduct = $productRepository->get('simple_with_cross');
+ $secondProduct = $productRepository->get('simple_with_cross', false, null, true);
$productRepository->delete($secondProduct);
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
//Product already removed
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_rollback.php
index fe0a3b7dcee7b..937acbc353cbe 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/products_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/products_rollback.php
@@ -16,14 +16,14 @@
$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->get('Magento\Catalog\Api\ProductRepositoryInterface');
try {
- $product = $productRepository->get('simple');
+ $product = $productRepository->get('simple', false, null, true);
$productRepository->delete($product);
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
//Product already removed
}
try {
- $customDesignProduct = $productRepository->get('custom-design-simple-product');
+ $customDesignProduct = $productRepository->get('custom-design-simple-product', false, null, true);
$productRepository->delete($customDesignProduct);
} catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
//Product already removed
diff --git a/dev/tests/integration/testsuite/Magento/Catalog/_files/url_rewrites_rollback.php b/dev/tests/integration/testsuite/Magento/Catalog/_files/url_rewrites_rollback.php
index 5df750399d340..6f7a39fd4acd1 100644
--- a/dev/tests/integration/testsuite/Magento/Catalog/_files/url_rewrites_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Catalog/_files/url_rewrites_rollback.php
@@ -15,7 +15,7 @@
->create('Magento\Catalog\Api\ProductRepositoryInterface');
try {
- $product = $productRepository->get('simple');
+ $product = $productRepository->get('simple', false, null, true);
$productRepository->delete($product);
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
//Product already removed
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/PriceTest.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/PriceTest.php
index 24c80a4a6111b..23918aeecd364 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/PriceTest.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/Model/Product/Type/Configurable/PriceTest.php
@@ -28,7 +28,6 @@ protected function setUp()
}
/**
- * @magentoDbIsolation enabled
* @magentoDataFixture Magento/ConfigurableProduct/_files/tax_rule.php
* @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
*/
@@ -39,7 +38,6 @@ public function testGetFinalPrice()
/**
* @magentoConfigFixture current_store tax/display/type 1
- * @magentoDbIsolation enabled
* @magentoDataFixture Magento/ConfigurableProduct/_files/tax_rule.php
* @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
*/
@@ -50,7 +48,6 @@ public function testGetFinalPriceExcludingTax()
/**
* @magentoConfigFixture current_store tax/display/type 2
- * @magentoDbIsolation enabled
* @magentoDataFixture Magento/ConfigurableProduct/_files/tax_rule.php
* @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
*/
@@ -62,7 +59,6 @@ public function testGetFinalPriceIncludingTax()
/**
* @magentoConfigFixture current_store tax/display/type 3
- * @magentoDbIsolation enabled
* @magentoDataFixture Magento/ConfigurableProduct/_files/tax_rule.php
* @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
*/
@@ -73,7 +69,6 @@ public function testGetFinalPriceIncludingExcludingTax()
}
/**
- * @magentoDbIsolation enabled
* @magentoDataFixture Magento/ConfigurableProduct/_files/tax_rule.php
* @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
*/
@@ -85,7 +80,6 @@ public function testGetFinalPriceWithSelectedSimpleProduct()
}
/**
- * @magentoDbIsolation enabled
* @magentoDataFixture Magento/ConfigurableProduct/_files/tax_rule.php
* @magentoDataFixture Magento/ConfigurableProduct/_files/product_configurable.php
*/
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable.php
index 7f7b89f4146e1..45a41ed120265 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable.php
@@ -15,6 +15,8 @@
use Magento\Eav\Api\Data\AttributeOptionInterface;
use Magento\TestFramework\Helper\Bootstrap;
+\Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize();
+
require __DIR__ . '/configurable_attribute.php';
/** @var ProductRepositoryInterface $productRepository */
diff --git a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_rollback.php b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_rollback.php
index 5c55c5854ec06..50c740c3ad06e 100644
--- a/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/ConfigurableProduct/_files/product_configurable_rollback.php
@@ -18,7 +18,7 @@
foreach (['simple_10', 'simple_20', 'configurable'] as $sku) {
try {
- $product = $productRepository->get($sku);
+ $product = $productRepository->get($sku, false, null, true);
$stockStatus = $objectManager->create('Magento\CatalogInventory\Model\Stock\Status');
$stockStatus->load($product->getEntityId(), 'product_id');
diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_downloadable_rollback.php b/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_downloadable_rollback.php
index 08b9da6388c29..c7496dbce8f24 100644
--- a/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_downloadable_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Downloadable/_files/product_downloadable_rollback.php
@@ -17,7 +17,7 @@
$productRepository = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
->get('Magento\Catalog\Api\ProductRepositoryInterface');
try {
- $product = $productRepository->get('downloadable-product');
+ $product = $productRepository->get('downloadable-product', false, null, true);
$productRepository->delete($product);
} catch (NoSuchEntityException $e) {
diff --git a/dev/tests/integration/testsuite/Magento/GroupedProduct/_files/product_grouped_rollback.php b/dev/tests/integration/testsuite/Magento/GroupedProduct/_files/product_grouped_rollback.php
index b885ddcb1fe3a..dd6e898cc0302 100644
--- a/dev/tests/integration/testsuite/Magento/GroupedProduct/_files/product_grouped_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/GroupedProduct/_files/product_grouped_rollback.php
@@ -18,7 +18,7 @@
$registry->register('isSecureArea', true);
try {
/** @var $simpleProduct \Magento\Catalog\Model\Product */
- $simpleProduct = $productRepository->get('simple-1');
+ $simpleProduct = $productRepository->get('simple-1', false, null, true);
$simpleProduct->delete();
} catch (NoSuchEntityException $e) {
//already deleted
@@ -35,7 +35,7 @@
try {
/** @var $groupedProduct \Magento\Catalog\Model\Product */
- $groupedProduct = $productRepository->get('grouped-product');
+ $groupedProduct = $productRepository->get('grouped-product', false, null, true);
$groupedProduct->delete();
} catch (NoSuchEntityException $e) {
//already deleted
diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/quote_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/quote_rollback.php
index 142e320b40e7a..09909174ee3ff 100644
--- a/dev/tests/integration/testsuite/Magento/Sales/_files/quote_rollback.php
+++ b/dev/tests/integration/testsuite/Magento/Sales/_files/quote_rollback.php
@@ -21,7 +21,7 @@
->create('Magento\Catalog\Api\ProductRepositoryInterface');
try {
- $product = $productRepository->get('simple');
+ $product = $productRepository->get('simple', false, null, true);
$productRepository->delete($product);
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
//Product already removed
diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php
index b9c4c7cbb9471..770cd155169eb 100644
--- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php
+++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/DiConfigFilesTest.php
@@ -55,11 +55,12 @@ protected function _prepareFiles()
}
/**
+ * @param string $filePath
* @param string $xml
- * @return void
+ * @throws \Exception
* @dataProvider linearFilesProvider
*/
- public function testDiConfigFileWithoutMerging($xml)
+ public function testDiConfigFileWithoutMerging($filePath, $xml)
{
/** @var \Magento\Framework\ObjectManager\Config\SchemaLocator $schemaLocator */
$schemaLocator = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
@@ -74,7 +75,10 @@ public function testDiConfigFileWithoutMerging($xml)
libxml_use_internal_errors(false);
if (!empty($result)) {
- $this->fail('File ' . $xml . ' has invalid xml structure.');
+ $this->fail(
+ 'File ' . $filePath . ' has invalid xml structure. '
+ . implode("\n", $result)
+ );
}
}
@@ -91,8 +95,8 @@ public function linearFilesProvider()
}
$output = [];
- foreach ($common as $path => $file) {
- $output[substr($path, strlen(BP))] = [$file];
+ foreach ($common as $path => $content) {
+ $output[] = [substr($path, strlen(BP)), $content];
}
return $output;
diff --git a/lib/internal/Magento/Framework/Model/AbstractModel.php b/lib/internal/Magento/Framework/Model/AbstractModel.php
index d53820eff1855..742861cbe4115 100644
--- a/lib/internal/Magento/Framework/Model/AbstractModel.php
+++ b/lib/internal/Magento/Framework/Model/AbstractModel.php
@@ -520,6 +520,7 @@ public function getCollection()
/**
* Load object data
*
+ * @deprecated
* @param integer $modelId
* @param null|string $field
* @return $this
@@ -621,6 +622,7 @@ public function setHasDataChanges($flag)
/**
* Save object data
*
+ * @deprecated
* @return $this
* @throws \Exception
*/
@@ -805,6 +807,7 @@ public function afterSave()
/**
* Delete object from database
*
+ * @deprecated
* @return $this
* @throws \Exception
*/
diff --git a/lib/internal/Magento/Framework/Model/ResourceModel/Db/UpdateEntityRow.php b/lib/internal/Magento/Framework/Model/ResourceModel/Db/UpdateEntityRow.php
index 26e52091d63c9..fc4d58e95f6ea 100755
--- a/lib/internal/Magento/Framework/Model/ResourceModel/Db/UpdateEntityRow.php
+++ b/lib/internal/Magento/Framework/Model/ResourceModel/Db/UpdateEntityRow.php
@@ -41,7 +41,7 @@ protected function prepareData(EntityMetadata $metadata, $data)
if ($column['DEFAULT'] == 'CURRENT_TIMESTAMP' || $column['IDENTITY']) {
continue;
}
- if (isset($data[strtolower($column['COLUMN_NAME'])])) {
+ if (array_key_exists(strtolower($column['COLUMN_NAME']), $data)) {
$output[strtolower($column['COLUMN_NAME'])] = $data[strtolower($column['COLUMN_NAME'])];
}
}