Skip to content

Commit 3149102

Browse files
ACPT-1327
Updating unit test DynamicFieldTest
1 parent 06ecb2a commit 3149102

File tree

1 file changed

+9
-2
lines changed
  • app/code/Magento/Elasticsearch/Test/Unit/Model/Adapter/FieldMapper/Product/FieldProvider

1 file changed

+9
-2
lines changed

app/code/Magento/Elasticsearch/Test/Unit/Model/Adapter/FieldMapper/Product/FieldProvider/DynamicFieldTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\Elasticsearch\Test\Unit\Model\Adapter\FieldMapper\Product\FieldProvider;
99

1010
use Magento\Catalog\Model\ResourceModel\Category\Collection;
11+
use Magento\Catalog\Model\ResourceModel\Category\CollectionFactory;
1112
use Magento\Customer\Api\Data\GroupInterface;
1213
use Magento\Customer\Api\Data\GroupSearchResultsInterface;
1314
use Magento\Customer\Api\GroupRepositoryInterface;
@@ -111,8 +112,13 @@ protected function setUp(): void
111112
->disableOriginalConstructor()
112113
->onlyMethods(['getAllIds'])
113114
->getMock();
115+
$categoryCollection = $this->getMockBuilder(CollectionFactory::class)
116+
->disableOriginalConstructor()
117+
->onlyMethods(['create'])
118+
->getMock();
119+
$categoryCollection->method('create')
120+
->willReturn($this->categoryCollection);
114121
$this->storeManager = $this->createMock(StoreManagerInterface::class);
115-
116122
$this->provider = new DynamicField(
117123
$this->fieldTypeConverter,
118124
$this->indexTypeConverter,
@@ -121,7 +127,8 @@ protected function setUp(): void
121127
$this->fieldNameResolver,
122128
$this->attributeAdapterProvider,
123129
$this->categoryCollection,
124-
$this->storeManager
130+
$this->storeManager,
131+
$categoryCollection
125132
);
126133
}
127134

0 commit comments

Comments
 (0)