Skip to content

Commit 3895af0

Browse files
MAGETWO-95753: [2.3] Cannot save product with Tier Prices
1 parent 63cc753 commit 3895af0

File tree

1 file changed

+9
-9
lines changed
  • dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml

1 file changed

+9
-9
lines changed

dev/tests/integration/testsuite/Magento/Catalog/Controller/Adminhtml/ProductTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
use Magento\Framework\App\Request\DataPersistorInterface;
99
use Magento\Framework\Message\Manager;
1010
use Magento\Framework\App\Request\Http as HttpRequest;
11+
use Magento\Catalog\Api\ProductRepositoryInterface;
12+
use Magento\Framework\Message\MessageInterface;
1113

1214
/**
1315
* @magentoAppArea adminhtml
@@ -24,7 +26,7 @@ public function testSaveActionWithDangerRequest()
2426
$this->dispatch('backend/catalog/product/save');
2527
$this->assertSessionMessages(
2628
$this->equalTo(['The product was unable to be saved. Please try again.']),
27-
\Magento\Framework\Message\MessageInterface::TYPE_ERROR
29+
MessageInterface::TYPE_ERROR
2830
);
2931
$this->assertRedirect($this->stringContains('/backend/catalog/product/new'));
3032
}
@@ -44,7 +46,7 @@ public function testSaveActionAndNew()
4446
$this->assertRedirect($this->stringStartsWith('http://localhost/index.php/backend/catalog/product/new/'));
4547
$this->assertSessionMessages(
4648
$this->contains('You saved the product.'),
47-
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
49+
MessageInterface::TYPE_SUCCESS
4850
);
4951
}
5052

@@ -71,11 +73,11 @@ public function testSaveActionAndDuplicate()
7173
);
7274
$this->assertSessionMessages(
7375
$this->contains('You saved the product.'),
74-
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
76+
MessageInterface::TYPE_SUCCESS
7577
);
7678
$this->assertSessionMessages(
7779
$this->contains('You duplicated the product.'),
78-
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
80+
MessageInterface::TYPE_SUCCESS
7981
);
8082
}
8183

@@ -260,9 +262,7 @@ public function saveActionWithAlreadyExistingUrlKeyDataProvider()
260262
* @param array $postData
261263
* @param array $tierPrice
262264
* @magentoDataFixture Magento/Catalog/_files/product_has_tier_price_show_as_low_as.php
263-
* @magentoAppIsolation enabled
264265
* @magentoConfigFixture current_store catalog/price/scope 1
265-
* @magentoDbIsolation disabled
266266
*/
267267
public function testSaveActionTierPrice(array $postData, array $tierPrice)
268268
{
@@ -272,7 +272,7 @@ public function testSaveActionTierPrice(array $postData, array $tierPrice)
272272
$this->dispatch('backend/catalog/product/save/id/' . $postData['id']);
273273
$this->assertSessionMessages(
274274
$this->contains('You saved the product.'),
275-
\Magento\Framework\Message\MessageInterface::TYPE_SUCCESS
275+
MessageInterface::TYPE_SUCCESS
276276
);
277277
}
278278

@@ -349,8 +349,8 @@ public function saveActionTierPriceDataProvider()
349349
*/
350350
private function getProductData(array $tierPrice)
351351
{
352-
$repository = $this->_objectManager->create(\Magento\Catalog\Model\ProductRepository::class);
353-
$product = $repository->get('tier_prices')->getData();
352+
$productRepositoryInterface = $this->_objectManager->get(ProductRepositoryInterface::class);
353+
$product = $productRepositoryInterface->get('tier_prices')->getData();
354354
$product['tier_price'] = $tierPrice;
355355
unset($product['entity_id']);
356356
return $product;

0 commit comments

Comments
 (0)