Example #1
0
 public function testExtractCustomerDataWithFactory()
 {
     /** @var \Magento\Customer\Model\Metadata\FormFactory|\PHPUnit_Framework_MockObject_MockObject */
     $mockFormFactory = $this->getMockBuilder('\\Magento\\Customer\\Model\\Metadata\\FormFactory')->disableOriginalConstructor()->setMethods(array('create'))->getMock();
     $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this);
     $arguments = array('formFactory' => $mockFormFactory);
     $this->_dataHelper = $objectManagerHelper->getObject('\\Magento\\Customer\\Helper\\Data', $arguments);
     $mockFormFactory->expects($this->once())->method('create')->with(self::ENTITY, self::FORM_CODE, [], false, \Magento\Customer\Model\Metadata\Form::DONT_IGNORE_INVISIBLE)->will($this->returnValue($this->_mockMetadataForm));
     $this->assertEquals($this->_expected, $this->_dataHelper->extractCustomerData($this->_mockRequest, self::FORM_CODE, self::ENTITY, $this->_additionalAttributes, self::SCOPE));
 }