Skip to content

Commit 2969d57

Browse files
author
Igor Melnikov
committed
MAGETWO-67871: Requesting autogenerated classes that are not in constructor cause fatal errors in production mode
- fix test
1 parent 54c5aad commit 2969d57

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

app/code/Magento/Multishipping/Test/Unit/Model/Checkout/Type/MultishippingTest.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ protected function setUp()
149149
$this->customerSessionMock->expects($this->atLeastOnce())->method('getCustomerDataObject')
150150
->willReturn($this->customerMock);
151151
$this->totalsCollectorMock = $this->createSimpleMock(TotalsCollector::class);
152+
$this->cartExtensionFactoryMock = $this->getMockBuilder(CartExtensionFactory::class)
153+
->setMethods(['create'])
154+
->disableOriginalConstructor()
155+
->getMock();
152156
$allowedCountryReaderMock = $this->getMockBuilder(AllowedCountries::class)
153157
->disableOriginalConstructor()
154158
->setMethods(['getAllowedCountries'])
@@ -179,21 +183,13 @@ protected function setUp()
179183
$this->filterBuilderMock,
180184
$this->totalsCollectorMock,
181185
$data,
186+
$this->cartExtensionFactoryMock,
182187
$allowedCountryReaderMock
183188
);
184189

185-
$this->cartExtensionFactoryMock = $this->getMockBuilder(CartExtensionFactory::class)
186-
->setMethods(['create'])
187-
->disableOriginalConstructor()
188-
->getMock();
189190
$this->shippingAssignmentProcessorMock = $this->createSimpleMock(ShippingAssignmentProcessor::class);
190191

191192
$objectManager = new ObjectManager($this);
192-
$objectManager->setBackwardCompatibleProperty(
193-
$this->model,
194-
'cartExtensionFactory',
195-
$this->cartExtensionFactoryMock
196-
);
197193
$objectManager->setBackwardCompatibleProperty(
198194
$this->model,
199195
'shippingAssignmentProcessor',

0 commit comments

Comments
 (0)