54 $this->contextMock = $this->createMock(\
Magento\Framework\Model\Context::class);
55 $this->registryMock = $this->createMock(\
Magento\Framework\Registry::class);
56 $this->directoryDataMock = $this->createMock(\
Magento\Directory\Helper\Data::class);
57 $this->eavConfigMock = $this->createMock(\
Magento\Eav\Model\Config::class);
58 $this->addressConfigMock = $this->createMock(\
Magento\Customer\Model\Address\Config::class);
59 $this->regionFactoryMock = $this->createPartialMock(\
Magento\Directory\Model\RegionFactory::class, [
'create']);
60 $this->countryFactoryMock = $this->createPartialMock(
61 \
Magento\Directory\Model\CountryFactory::class,
64 $regionCollectionMock = $this->createMock(\
Magento\Directory\Model\
ResourceModel\Region\Collection::class);
65 $regionCollectionMock->expects($this->any())
67 ->will($this->returnValue(0));
68 $countryMock = $this->createMock(\
Magento\Directory\Model\Country::class);
69 $countryMock->expects($this->any())
70 ->method(
'getRegionCollection')
71 ->will($this->returnValue($regionCollectionMock));
72 $this->countryFactoryMock->expects($this->any())
74 ->will($this->returnValue($countryMock));
77 $this->resourceCollectionMock = $this->getMockBuilder(\
Magento\Framework\Data\Collection\AbstractDb::class)
78 ->disableOriginalConstructor()
79 ->getMockForAbstractClass();
80 $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
81 $this->compositeValidatorMock = $this->createMock(CompositeValidator::class);
82 $this->model = $this->objectManager->getObject(
83 \
Magento\Customer\Model\Address\AbstractAddress::class,
85 'context' => $this->contextMock,
86 'registry' => $this->registryMock,
87 'directoryData' => $this->directoryDataMock,
88 'eavConfig' => $this->eavConfigMock,
89 'addressConfig' => $this->addressConfigMock,
90 'regionFactory' => $this->regionFactoryMock,
91 'countryFactory' => $this->countryFactoryMock,
92 'resource' => $this->resourceMock,
93 'resourceCollection' => $this->resourceCollectionMock,
94 'compositeValidator' => $this->compositeValidatorMock,