Skip to content

Commit 169bc89

Browse files
author
Oleksii Korshenko
committed
MAGETWO-62013: Fix class constructors in a backward compatible way - 2.1.3
1 parent a695ebe commit 169bc89

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
lines changed

app/code/Magento/Backend/Test/Unit/App/ConfigTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ protected function setUp()
3434
'',
3535
false
3636
);
37-
$this->model = new \Magento\Backend\App\Config($this->appConfig);
37+
$this->model = new \Magento\Backend\App\Config(
38+
$this->getMock(\Magento\Framework\App\Config\ScopePool::class, [], [], '', false, false),
39+
$this->appConfig
40+
);
3841
}
3942

4043
public function testGetValue()

app/code/Magento/Sales/Test/Unit/Model/InvoiceOrderTest.php

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use Magento\Sales\Model\ValidatorResultInterface;
2424
use Magento\Sales\Model\InvoiceOrder;
2525
use Psr\Log\LoggerInterface;
26+
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
2627

2728
/**
2829
* Class InvoiceOrderTest
@@ -119,6 +120,8 @@ class InvoiceOrderTest extends \PHPUnit_Framework_TestCase
119120

120121
protected function setUp()
121122
{
123+
$objectManager = new ObjectManager($this);
124+
122125
$this->resourceConnectionMock = $this->getMockBuilder(ResourceConnection::class)
123126
->disableOriginalConstructor()
124127
->getMock();
@@ -184,17 +187,20 @@ protected function setUp()
184187
->setMethods(['hasMessages', 'getMessages', 'addMessage'])
185188
->getMock();
186189

187-
$this->invoiceOrder = new InvoiceOrder(
188-
$this->resourceConnectionMock,
189-
$this->orderRepositoryMock,
190-
$this->invoiceDocumentFactoryMock,
191-
$this->paymentAdapterMock,
192-
$this->orderStateResolverMock,
193-
$this->configMock,
194-
$this->invoiceRepositoryMock,
195-
$this->invoiceOrderValidatorMock,
196-
$this->notifierInterfaceMock,
197-
$this->loggerMock
190+
$this->invoiceOrder = $objectManager->getObject(
191+
InvoiceOrder::class,
192+
[
193+
'resourceConnection' => $this->resourceConnectionMock,
194+
'orderRepository' => $this->orderRepositoryMock,
195+
'invoiceDocumentFactory' => $this->invoiceDocumentFactoryMock,
196+
'paymentAdapter' => $this->paymentAdapterMock,
197+
'orderStateResolver' => $this->orderStateResolverMock,
198+
'config' => $this->configMock,
199+
'invoiceRepository' => $this->invoiceRepositoryMock,
200+
'invoiceOrderValidator' => $this->invoiceOrderValidatorMock,
201+
'notifierInterface' => $this->notifierInterfaceMock,
202+
'logger' => $this->loggerMock
203+
]
198204
);
199205
}
200206

app/code/Magento/Store/Test/Unit/Model/Config/Processor/PlaceholderTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ protected function setUp()
3636
['key2' => 'value2-processed']
3737
);
3838

39-
$this->model = new \Magento\Store\Model\Config\Processor\Placeholder($this->configPlaceholderMock);
39+
$this->model = new \Magento\Store\Model\Config\Processor\Placeholder(
40+
$this->getMock(\Magento\Framework\App\RequestInterface::class),
41+
[],
42+
null,
43+
$this->configPlaceholderMock
44+
);
4045
}
4146

4247
public function testProcess()

0 commit comments

Comments
 (0)