48 private $directoryDataHelperMock;
52 $this->countryCollectionFactoryMock = $this->createPartialMock(
56 $this->countryCollectionMock = $this->createMock(
59 $this->regionCollectionFactoryMock = $this->createPartialMock(
63 $this->regionCollectionMock = $this->createMock(
66 $this->storeResolverMock = $this->createMock(
67 \
Magento\Store\Api\StoreResolverInterface::class
69 $this->directoryDataHelperMock = $this->createMock(\
Magento\Directory\Helper\Data::class);
70 $this->storeManagerMock = $this->getMockBuilder(\
Magento\Store\Model\StoreManagerInterface::class)
71 ->disableOriginalConstructor()
74 $this->model = new \Magento\Checkout\Block\Checkout\DirectoryDataProcessor(
75 $this->countryCollectionFactoryMock,
76 $this->regionCollectionFactoryMock,
77 $this->storeResolverMock,
78 $this->directoryDataHelperMock,
79 $this->storeManagerMock
85 $expectedResult[
'components'][
'checkoutProvider'][
'dictionaries'] = [
90 $storeMock = $this->getMockBuilder(\
Magento\Store\Api\
Data\StoreInterface::class)
91 ->disableOriginalConstructor()
93 $storeMock->expects($this->atLeastOnce())->method(
'getId')->willReturn(42);
94 $this->storeManagerMock->expects($this->atLeastOnce())->method(
'getStore')->willReturn($storeMock);
96 $this->countryCollectionFactoryMock->expects($this->once())
98 ->willReturn($this->countryCollectionMock);
99 $this->countryCollectionMock->expects($this->once())->method(
'loadByStore')->willReturnSelf();
100 $this->countryCollectionMock->expects($this->once())->method(
'toOptionArray')->willReturn([]);
101 $this->regionCollectionFactoryMock->expects($this->once())
103 ->willReturn($this->regionCollectionMock);
104 $this->regionCollectionMock->expects($this->once())->method(
'addAllowedCountriesFilter')->willReturnSelf();
105 $this->regionCollectionMock->expects($this->once())->method(
'toOptionArray')->willReturn([]);
107 $this->assertEquals($expectedResult, $this->model->process([]));
$countryCollectionFactoryMock
$regionCollectionFactoryMock