56 $this->request = $this->getMockBuilder(\
Magento\Framework\
App\Request\Http::class)
57 ->disableOriginalConstructor()
60 $this->scopeFallbackResolver = $this->getMockBuilder(
61 \
Magento\Framework\
App\ScopeFallbackResolverInterface::class
62 )->getMockForAbstractClass();
64 $this->designConfigRepository = $this->getMockBuilder(\
Magento\
Theme\Api\DesignConfigRepositoryInterface::class)
65 ->getMockForAbstractClass();
66 $this->designConfig = $this->getMockBuilder(\
Magento\
Theme\Api\
Data\DesignConfigInterface::class)
67 ->getMockForAbstractClass();
68 $this->designConfigData = $this->getMockBuilder(\
Magento\
Theme\Api\
Data\DesignConfigDataInterface::class)
69 ->getMockForAbstractClass();
70 $this->designConfigExtension = $this->getMockBuilder(
73 ->setMethods([
'getDesignConfigData'])
74 ->getMockForAbstractClass();
75 $this->storeManager = $this->getMockBuilder(\
Magento\Store\Model\StoreManagerInterface::class)
76 ->getMockForAbstractClass();
80 $this->scopeFallbackResolver,
81 $this->designConfigRepository,
97 $this->request->expects($this->exactly(2))
100 [
'scope',
null, $scope],
101 [
'scope_id',
null, $scopeId],
104 $this->scopeFallbackResolver->expects($this->atLeastOnce())
105 ->method(
'getFallbackScope')
106 ->with($scope, $scopeId)
107 ->willReturn([$scope, $scopeId]);
108 $this->storeManager->expects($this->once())
109 ->method(
'isSingleStoreMode')
112 $this->designConfigRepository->expects($this->once())
113 ->method(
'getByScope')
114 ->with($scope, $scopeId)
115 ->willReturn($this->designConfig);
116 $this->designConfig->expects($this->once())
117 ->method(
'getExtensionAttributes')
118 ->willReturn($this->designConfigExtension);
119 $this->designConfigExtension->expects($this->once())
120 ->method(
'getDesignConfigData')
121 ->willReturn([$this->designConfigData]);
122 $this->designConfigData->expects($this->atLeastOnce())
123 ->method(
'getFieldConfig')
126 'fieldset' =>
'fieldset1' 128 $this->designConfigData->expects($this->once())
130 ->willReturn(
'value');
132 $result = $this->model->getData();
140 'default' =>
'value',
141 'showFallbackReset' => $showFallbackReset,
150 $this->assertEquals($expected,
$result);