13 private $_objectManager;
16 private $_attributeMetadata;
19 private $_entityTypeCode =
'customer_address';
22 private $_elementFactory;
26 $this->_objectManager = $this->createMock(\
Magento\Framework\ObjectManagerInterface::class);
27 $this->_attributeMetadata = $this->createMock(\
Magento\
Customer\Model\Data\AttributeMetadata::class);
28 $this->_elementFactory =
new ElementFactory($this->_objectManager,
new \
Magento\Framework\Stdlib\StringUtils());
34 $this->_attributeMetadata->expects(
43 $this->_objectManager->expects($this->once())->method(
'create')->will($this->returnValue($dataModel));
45 $actual = $this->_elementFactory->create($this->_attributeMetadata,
'95131', $this->_entityTypeCode);
46 $this->assertSame($dataModel, $actual);
51 $this->_attributeMetadata->expects($this->once())->method(
'getDataModel')->will($this->returnValue(
''));
52 $this->_attributeMetadata->expects(
57 $this->returnValue(
'text')
62 'entityTypeCode' => $this->_entityTypeCode,
63 'value' =>
'Some Text',
65 'attribute' => $this->_attributeMetadata,
67 $this->_objectManager->expects(
75 $this->returnValue($dataModel)
78 $actual = $this->_elementFactory->create($this->_attributeMetadata,
'Some Text', $this->_entityTypeCode);
79 $this->assertSame($dataModel, $actual);
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]