8
8
use Magento \Framework \App \Request \DataPersistorInterface ;
9
9
use Magento \Framework \Message \Manager ;
10
10
use Magento \Framework \App \Request \Http as HttpRequest ;
11
+ use Magento \Catalog \Api \ProductRepositoryInterface ;
12
+ use Magento \Framework \Message \MessageInterface ;
11
13
12
14
/**
13
15
* @magentoAppArea adminhtml
@@ -24,7 +26,7 @@ public function testSaveActionWithDangerRequest()
24
26
$ this ->dispatch ('backend/catalog/product/save ' );
25
27
$ this ->assertSessionMessages (
26
28
$ this ->equalTo (['The product was unable to be saved. Please try again. ' ]),
27
- \ Magento \ Framework \ Message \ MessageInterface::TYPE_ERROR
29
+ MessageInterface::TYPE_ERROR
28
30
);
29
31
$ this ->assertRedirect ($ this ->stringContains ('/backend/catalog/product/new ' ));
30
32
}
@@ -44,7 +46,7 @@ public function testSaveActionAndNew()
44
46
$ this ->assertRedirect ($ this ->stringStartsWith ('http://localhost/index.php/backend/catalog/product/new/ ' ));
45
47
$ this ->assertSessionMessages (
46
48
$ this ->contains ('You saved the product. ' ),
47
- \ Magento \ Framework \ Message \ MessageInterface::TYPE_SUCCESS
49
+ MessageInterface::TYPE_SUCCESS
48
50
);
49
51
}
50
52
@@ -71,11 +73,11 @@ public function testSaveActionAndDuplicate()
71
73
);
72
74
$ this ->assertSessionMessages (
73
75
$ this ->contains ('You saved the product. ' ),
74
- \ Magento \ Framework \ Message \ MessageInterface::TYPE_SUCCESS
76
+ MessageInterface::TYPE_SUCCESS
75
77
);
76
78
$ this ->assertSessionMessages (
77
79
$ this ->contains ('You duplicated the product. ' ),
78
- \ Magento \ Framework \ Message \ MessageInterface::TYPE_SUCCESS
80
+ MessageInterface::TYPE_SUCCESS
79
81
);
80
82
}
81
83
@@ -260,9 +262,7 @@ public function saveActionWithAlreadyExistingUrlKeyDataProvider()
260
262
* @param array $postData
261
263
* @param array $tierPrice
262
264
* @magentoDataFixture Magento/Catalog/_files/product_has_tier_price_show_as_low_as.php
263
- * @magentoAppIsolation enabled
264
265
* @magentoConfigFixture current_store catalog/price/scope 1
265
- * @magentoDbIsolation disabled
266
266
*/
267
267
public function testSaveActionTierPrice (array $ postData , array $ tierPrice )
268
268
{
@@ -272,7 +272,7 @@ public function testSaveActionTierPrice(array $postData, array $tierPrice)
272
272
$ this ->dispatch ('backend/catalog/product/save/id/ ' . $ postData ['id ' ]);
273
273
$ this ->assertSessionMessages (
274
274
$ this ->contains ('You saved the product. ' ),
275
- \ Magento \ Framework \ Message \ MessageInterface::TYPE_SUCCESS
275
+ MessageInterface::TYPE_SUCCESS
276
276
);
277
277
}
278
278
@@ -349,8 +349,8 @@ public function saveActionTierPriceDataProvider()
349
349
*/
350
350
private function getProductData (array $ tierPrice )
351
351
{
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 ();
354
354
$ product ['tier_price ' ] = $ tierPrice ;
355
355
unset($ product ['entity_id ' ]);
356
356
return $ product ;
0 commit comments