6
6
7
7
namespace Magento \Multishipping \Block \Checkout ;
8
8
9
- use Magento \Catalog \Model \Product ;
9
+ use Magento \Catalog \Model \ProductRepository ;
10
10
use Magento \Checkout \Block \Cart \Item \Renderer ;
11
11
use Magento \Framework \App \Area ;
12
12
use Magento \Framework \ObjectManagerInterface ;
@@ -26,20 +26,20 @@ class OverviewTest extends TestCase
26
26
/**
27
27
* @var Overview
28
28
*/
29
- protected $ block ;
29
+ private $ block ;
30
30
31
31
/**
32
32
* @var ObjectManagerInterface
33
33
*/
34
- protected $ objectManager ;
34
+ private $ objectManager ;
35
35
36
36
/**
37
37
* @var Quote
38
38
*/
39
39
private $ quote ;
40
40
41
41
/**
42
- * @var Product
42
+ * @var ProductRepository
43
43
*/
44
44
private $ product ;
45
45
@@ -48,6 +48,9 @@ class OverviewTest extends TestCase
48
48
*/
49
49
private $ item ;
50
50
51
+ /**
52
+ * @inheritdoc
53
+ */
51
54
protected function setUp (): void
52
55
{
53
56
Bootstrap::getInstance ()->loadArea (Area::AREA_FRONTEND );
@@ -72,17 +75,17 @@ protected function setUp(): void
72
75
Renderer::class,
73
76
['template ' => 'cart/item/default.phtml ' ]
74
77
);
75
- $ this ->quote = $ this ->objectManager ->get (Quote::class);
76
- $ this ->product = $ this ->objectManager ->get (Product ::class);
77
- $ this ->item = $ this ->objectManager ->get (Item::class);
78
+ $ this ->quote = $ this ->objectManager ->create (Quote::class);
79
+ $ this ->product = $ this ->objectManager ->create (ProductRepository ::class);
80
+ $ this ->item = $ this ->objectManager ->create (Item::class);
78
81
}
79
82
80
83
/**
81
84
* @magentoDataFixture Magento/Catalog/_files/product_simple.php
82
85
*/
83
86
public function testGetRowItemHtml ()
84
87
{
85
- $ product = $ this ->product ->load ( ' 1 ' );
88
+ $ product = $ this ->product ->get ( ' simple ' );
86
89
$ item = $ this ->item ->setProduct ($ product );
87
90
$ item ->setQuote ($ this ->quote );
88
91
// assure that default renderer was obtained
0 commit comments