@@ -46,11 +46,18 @@ class ImageTest extends \PHPUnit\Framework\TestCase
46
46
/** @var DesignLoader|\PHPUnit_Framework_MockObject_MockObject */
47
47
private $ designLoader ;
48
48
49
+ /**
50
+ * @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
51
+ */
52
+ protected $ objectManager ;
53
+
49
54
/**
50
55
* @inheritdoc
51
56
*/
52
57
public function setUp ()
53
58
{
59
+ $ this ->objectManager = new \Magento \Framework \TestFramework \Unit \Helper \ObjectManager ($ this );
60
+
54
61
$ this ->imageFactory = $ this ->getMockBuilder (ImageFactory::class)
55
62
->disableOriginalConstructor ()
56
63
->getMock ();
@@ -68,15 +75,20 @@ public function setUp()
68
75
$ this ->storeManager = $ this ->createMock (StoreManagerInterface::class);
69
76
$ this ->design = $ this ->createMock (DesignInterface::class);
70
77
$ this ->designLoader = $ this ->createMock (DesignLoader::class);
71
- $ this ->model = new Image (
72
- $ this ->imageFactory ,
73
- $ this ->state ,
74
- $ this ->storeManager ,
75
- $ this ->design ,
76
- $ this ->imageInterfaceFactory ,
77
- $ this ->imageCodes ,
78
- $ this ->designLoader
79
- );
78
+
79
+ $ this ->model = $ this ->objectManager
80
+ ->getObject (
81
+ Image::class,
82
+ [
83
+ 'imageFactory ' => $ this ->imageFactory ,
84
+ 'state ' => $ this ->state ,
85
+ 'storeManager ' => $ this ->storeManager ,
86
+ 'design ' => $ this ->design ,
87
+ 'imageRenderInfoFactory ' => $ this ->imageInterfaceFactory ,
88
+ 'imageCodes ' => $ this ->imageCodes ,
89
+ 'designLoader ' => $ this ->designLoader ,
90
+ ]
91
+ );
80
92
}
81
93
82
94
public function testGet ()
0 commit comments