Skip to content

Commit 1029616

Browse files
Merge pull request #60 from magento-cia/cia-2.4.8-beta1-develop-2.4-develop-sync-08152024
Cia 2.4.8 beta1 develop 2.4 develop sync 08152024
2 parents b7c495d + ade1b07 commit 1029616

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

AdminAdobeIms/Test/Unit/Controller/Adminhtml/OAuth/ImsCallbackTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,10 @@ private function addMockData(): void
230230
->with('form_key')
231231
->willReturnSelf();
232232
$this->requestMock->expects($this->any())->method('getParam')
233-
->withConsecutive(['state'], ['locale'])
234-
->willReturnOnConsecutiveCalls('abc', 'en');
233+
->willReturnCallback(fn($param) => match ([$param]) {
234+
['state'] => 'abc',
235+
['locale'] => 'en'
236+
});
235237
$this->authSessionMock->expects($this->any())->method('setIsUrlNotice')
236238
->willReturnSelf();
237239
$this->authSessionMock->expects($this->any())->method('getLocale')
@@ -246,7 +248,9 @@ private function addMockData(): void
246248
$this->authMock->expects($this->any())->method('isLoggedIn')->willReturn(false);
247249
$this->objectManagerMock
248250
->method('get')
249-
->withConsecutive([Locale::class], [\Magento\Backend\Model\Locale\Manager::class])
250-
->willReturnOnConsecutiveCalls($this->localeMock, $this->managerMock);
251+
->willReturnCallback(fn($param) => match ([$param]) {
252+
[Locale::class] => $this->localeMock,
253+
[\Magento\Backend\Model\Locale\Manager::class] => $this->managerMock
254+
});
251255
}
252256
}

AdminAdobeIms/Test/Unit/Controller/Adminhtml/OAuth/ImsReauthCallbackTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ private function setMockData(): void
121121
->with('form_key')
122122
->willReturnSelf();
123123
$this->request->expects($this->any())->method('getParam')
124-
->withConsecutive(['state'], ['code'])
125-
->willReturnOnConsecutiveCalls(null, 'asdasdasdad');
124+
->willReturnCallback(fn($param) => match ([$param]) {
125+
['state'] => null,
126+
['code'] => 'asdasdasdad'
127+
});
126128
$this->resultFactory->expects($this->once())
127129
->method('create')
128130
->with(ResultFactory::TYPE_RAW)

AdminAdobeIms/Test/Unit/Model/ImsWebapiRepositoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ protected function setUp(): void
9090
$this->loggerMock = $this->createMock(LoggerInterface::class);
9191
$this->entityCollectionFactory = $this->getMockBuilder(CollectionFactory::class)
9292
->disableOriginalConstructor()
93-
->setMethods(['create'])
93+
->onlyMethods(['create'])
9494
->getMock();
9595

9696
$this->collectionProcessor = $this->createMock(CollectionProcessorInterface::class);
@@ -191,7 +191,7 @@ protected function initCollection(): array
191191
{
192192
$collectionSize = 1;
193193
$searchCriteriaMock = $this->getMockBuilder(SearchCriteriaInterface::class)
194-
->setMethods(['getPageSize'])
194+
->onlyMethods(['getPageSize'])
195195
->getMockForAbstractClass();
196196

197197
$searchCriteriaMock->expects($this->any())

AdminAdobeIms/Test/Unit/Plugin/ReplaceVerifyIdentityWithImsPluginTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected function setUp(): void
5555
$objectManagerHelper = new ObjectManagerHelper($this);
5656

5757
$this->storageMock = $this->getMockBuilder(StorageInterface::class)
58-
->setMethods(['getAdobeAccessToken', 'getAdobeReAuthToken', 'setAdobeReAuthToken'])
58+
->addMethods(['getAdobeAccessToken', 'getAdobeReAuthToken', 'setAdobeReAuthToken'])
5959
->getMockForAbstractClass();
6060

6161
$this->authMock = $this->getMockBuilder(Auth::class)

0 commit comments

Comments
 (0)