Skip to content

Commit 4805f82

Browse files
Andrei KuprienkaAndrei Kuprienka
authored andcommitted
MAGNIMEX-SPRINT2: Add lost php unit tests
fixed CategoryProcessorTest.php, ProductTest.php where builder is used for factories mocks
1 parent 90201b4 commit 4805f82

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/Product/CategoryProcessorTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,14 @@ protected function setUp()
8383

8484
$categoryColFactory->method('create')->will($this->returnValue($categoryCollection));
8585

86-
$categoryFactory = $this->getMockBuilder('Magento\Catalog\Model\CategoryFactory')
87-
->disableOriginalConstructor()
88-
->getMock();
86+
$categoryFactory = $this->getMock(
87+
'Magento\Catalog\Model\CategoryFactory',
88+
['create'],
89+
[],
90+
'',
91+
false
92+
);
93+
8994
$categoryFactory->method('create')->will($this->returnValue($childCategory));
9095

9196
$this->categoryProcessor =

app/code/Magento/CatalogImportExport/Test/Unit/Model/Import/ProductTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,14 @@ protected function setUp()
301301
$this->transactionManager =
302302
$this->getMockBuilder('\Magento\Framework\Model\Resource\Db\TransactionManagerInterface')
303303
->getMock();
304-
$this->catalogProductFactory =
305-
$this->getMockBuilder('\Magento\Catalog\Model\ProductFactory')
306-
->disableOriginalConstructor()
307-
->getMock();
304+
$this->catalogProductFactory = $this->getMock(
305+
'\Magento\Catalog\Model\ProductFactory',
306+
['create'],
307+
[],
308+
'',
309+
false
310+
);
311+
308312
$this->taxClassProcessor =
309313
$this->getMockBuilder('\Magento\CatalogImportExport\Model\Import\Product\TaxClassProcessor')
310314
->disableOriginalConstructor()

0 commit comments

Comments
 (0)