23 private $dataMapperFactoryMock;
28 private $dataMapperEntity;
35 $this->dataMapperFactoryMock = $this->getMockBuilder(DataMapperFactory::class)
36 ->disableOriginalConstructor()
38 $this->dataMapperEntity = $this->getMockBuilder(BatchDataMapperInterface::class)
39 ->disableOriginalConstructor()
41 $this->model = (
new ObjectManagerHelper($this))->getObject(
42 \
Magento\Elasticsearch\Model\Adapter\BatchDataMapper\DataMapperResolver::class,
44 'dataMapperFactory' => $this->dataMapperFactoryMock
51 $this->dataMapperEntity->expects($this->once())->method(
'map')->withAnyParameters();
52 $this->dataMapperFactoryMock->expects($this->once())->method(
'create')
54 ->willReturn($this->dataMapperEntity);
56 $this->model->map([
'data'], 1, []);
61 $this->dataMapperEntity->expects($this->once())->method(
'map')->withAnyParameters();
62 $this->dataMapperFactoryMock->expects($this->once())->method(
'create')
63 ->with(
'specific-type')
64 ->willReturn($this->dataMapperEntity);
66 $this->model->map([
'data'], 1, [
'entityType' =>
'specific-type']);
testMapWithDefaultEntityType()
testMapWithSpecifiedEntityType()