Skip to content

Commit 5f09d96

Browse files
committed
#28081 Add missing stub key that caused Unit Test failure
1 parent 286c0df commit 5f09d96

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

app/code/Magento/Config/Test/Unit/Model/Config/Backend/Email/LogoTest.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ protected function setUp(): void
8383
->disableOriginalConstructor()
8484
->getMock();
8585

86-
$this->uploaderFactoryMock->expects($this->any())
87-
->method('create')
86+
$this->uploaderFactoryMock->method('create')
8887
->willReturn($this->uploaderMock);
8988

9089
$this->filesystemMock->expects($this->once())
@@ -122,8 +121,7 @@ public function testBeforeSave()
122121
$this->model->setScopeCode($scopeCode);
123122
$_FILES['groups']['tmp_name'][$groupId]['fields'][$field]['value'] = $tmpFileName;
124123

125-
$this->scopeConfigMock->expects($this->any())
126-
->method('getValue')
124+
$this->scopeConfigMock->method('getValue')
127125
->with($path, $scope, $scopeCode)
128126
->willReturn($oldValue);
129127

@@ -132,6 +130,9 @@ public function testBeforeSave()
132130
->with(Logo::UPLOAD_DIR . '/' . $oldValue)
133131
->willReturn(true);
134132

133+
$this->uploaderMock->method('save')
134+
->willReturn(['file' => $oldValue]);
135+
135136
$this->assertEquals($this->model, $this->model->beforeSave());
136137
}
137138

@@ -153,8 +154,7 @@ public function testBeforeSaveWithTmpInValue()
153154
$this->model->setScope($scope);
154155
$this->model->setScopeCode($scopeCode);
155156

156-
$this->scopeConfigMock->expects($this->any())
157-
->method('getValue')
157+
$this->scopeConfigMock->method('getValue')
158158
->with($path, $scope, $scopeCode)
159159
->willReturn($oldValue);
160160

@@ -163,6 +163,9 @@ public function testBeforeSaveWithTmpInValue()
163163
->with(Logo::UPLOAD_DIR . '/' . $oldValue)
164164
->willReturn(true);
165165

166+
$this->uploaderMock->method('save')
167+
->willReturn(['file' => $oldValue]);
168+
166169
$this->assertEquals($this->model, $this->model->beforeSave());
167170
}
168171

@@ -184,8 +187,7 @@ public function testBeforeSaveWithDelete()
184187
$this->model->setScope($scope);
185188
$this->model->setScopeCode($scopeCode);
186189

187-
$this->scopeConfigMock->expects($this->any())
188-
->method('getValue')
190+
$this->scopeConfigMock->method('getValue')
189191
->with($path, $scope, $scopeCode)
190192
->willReturn($oldValue);
191193

@@ -215,8 +217,7 @@ public function testBeforeSaveWithoutOldValue()
215217
$this->model->setScope($scope);
216218
$this->model->setScopeCode($scopeCode);
217219

218-
$this->scopeConfigMock->expects($this->any())
219-
->method('getValue')
220+
$this->scopeConfigMock->method('getValue')
220221
->with($path, $scope, $scopeCode)
221222
->willReturn($oldValue);
222223

app/code/Magento/Config/Test/Unit/Model/Config/Backend/Image/LogoTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ public function testBeforeSave()
8686
$this->uploaderMock->expects($this->once())
8787
->method('setAllowedExtensions')
8888
->with(['jpg', 'jpeg', 'gif', 'png']);
89+
90+
$this->uploaderMock->method('save')
91+
->willReturn(['file' => 'filename']);
92+
8993
$this->model->beforeSave();
9094
}
9195
}

0 commit comments

Comments
 (0)