23
23
use Magento \Sales \Block \Adminhtml \Order \Create \Form ;
24
24
use Magento \Sales \Model \AdminOrder \Create ;
25
25
use Magento \Store \Model \Store ;
26
+ use Magento \Store \Model \StoreManagerInterface ;
26
27
use PHPUnit \Framework \TestCase ;
27
28
use PHPUnit_Framework_MockObject_MockObject as MockObject ;
28
29
@@ -51,6 +52,11 @@ class FormTest extends TestCase
51
52
*/
52
53
private $ block ;
53
54
55
+ /**
56
+ * @var StoreManagerInterface|MockObject
57
+ */
58
+ private $ storeManager ;
59
+
54
60
/**
55
61
* @inheritdoc
56
62
*/
@@ -60,6 +66,9 @@ protected function setUp()
60
66
$ context = $ this ->getMockBuilder (Context::class)
61
67
->disableOriginalConstructor ()
62
68
->getMock ();
69
+ $ this ->storeManager = $ this ->getMockForAbstractClass (StoreManagerInterface::class);
70
+ $ context ->method ('getStoreManager ' )
71
+ ->willReturn ($ this ->storeManager );
63
72
$ this ->quoteSession = $ this ->getMockBuilder (QuoteSession::class)
64
73
->disableOriginalConstructor ()
65
74
->setMethods (['getCustomerId ' , 'getQuoteId ' , 'getStoreId ' , 'getStore ' , 'getQuote ' ])
@@ -119,6 +128,8 @@ public function testGetOrderDataJson()
119
128
'quote_id ' => $ quoteId
120
129
];
121
130
131
+ $ this ->storeManager ->method ('setCurrentStore ' )
132
+ ->with ($ storeId );
122
133
$ this ->quoteSession ->method ('getCustomerId ' )
123
134
->willReturn ($ customerId );
124
135
$ this ->quoteSession ->method ('getStoreId ' )
0 commit comments