Skip to content

Commit f051379

Browse files
committed
MC-34039: Merge 2.4-develop into 2.4-develop-php74
1 parent df72ab3 commit f051379

File tree

1,764 files changed

+4564
-4580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,764 files changed

+4564
-4580
lines changed

app/code/Magento/AdminAnalytics/Test/Unit/Condition/CanViewNotificationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected function setUp(): void
3939
->getMockForAbstractClass();
4040
$this->logMock = $this->createMock(Log::class);
4141
$this->viewerLoggerMock = $this->createMock(Logger::class);
42-
$this->productMetadataMock = $this->createMock(ProductMetadataInterface::class);
42+
$this->productMetadataMock = $this->getMockForAbstractClass(ProductMetadataInterface::class);
4343
$objectManager = new ObjectManager($this);
4444
$this->canViewNotification = $objectManager->getObject(
4545
CanViewNotification::class,

app/code/Magento/AdminNotification/Test/Unit/Block/Grid/Renderer/ActionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function setUp(): void
3838
$escaperMock->expects($this->once())->method('escapeUrl')->willReturn('https://magento.com');
3939

4040
/** @var UrlInterface|MockObject $urlBuilder */
41-
$urlBuilder = $this->createMock(UrlInterface::class);
41+
$urlBuilder = $this->getMockForAbstractClass(UrlInterface::class);
4242
$urlBuilder->expects($this->once())->method('getUrl')->willReturn('http://magento.com');
4343

4444
/** @var Context|MockObject $contextMock */

app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/CacheOutdatedTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ class CacheOutdatedTest extends TestCase
3939

4040
protected function setUp(): void
4141
{
42-
$this->_authorizationMock = $this->createMock(AuthorizationInterface::class);
43-
$this->_urlInterfaceMock = $this->createMock(UrlInterface::class);
44-
$this->_cacheTypeListMock = $this->createMock(TypeListInterface::class);
42+
$this->_authorizationMock = $this->getMockForAbstractClass(AuthorizationInterface::class);
43+
$this->_urlInterfaceMock = $this->getMockForAbstractClass(UrlInterface::class);
44+
$this->_cacheTypeListMock = $this->getMockForAbstractClass(TypeListInterface::class);
4545

4646
$objectManagerHelper = new ObjectManager($this);
4747
$arguments = [

app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/SecurityTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class SecurityTest extends TestCase
4141
protected function setUp(): void
4242
{
4343
//Prepare objects for constructor
44-
$this->cacheMock = $this->createMock(CacheInterface::class);
45-
$this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class);
44+
$this->cacheMock = $this->getMockForAbstractClass(CacheInterface::class);
45+
$this->scopeConfigMock = $this->getMockForAbstractClass(ScopeConfigInterface::class);
4646
$this->curlFactoryMock = $this->createPartialMock(
4747
CurlFactory::class,
4848
['create']

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Export/AdvancedPricingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ protected function setUp(): void
208208
$this->storeResolver = $this->createMock(
209209
StoreResolver::class
210210
);
211-
$this->groupRepository = $this->createMock(GroupRepositoryInterface::class);
211+
$this->groupRepository = $this->getMockForAbstractClass(GroupRepositoryInterface::class);
212212
$this->writer = $this->createPartialMock(
213213
AbstractAdapter::class,
214214
[

app/code/Magento/AdvancedPricingImportExport/Test/Unit/Model/Import/AdvancedPricingTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ public function testSaveAndReplaceAdvancedPricesAddRowErrorCall()
330330
];
331331
$this->dataSourceModel->expects($this->at(0))->method('getNextBunch')->willReturn($testBunch);
332332
$this->advancedPricing->expects($this->once())->method('validateRow')->willReturn(false);
333-
$this->advancedPricing->method('saveProductPrices')->will($this->returnSelf());
333+
$this->advancedPricing->method('saveProductPrices')->willReturnSelf();
334334

335335
$this->advancedPricing
336336
->expects($this->once())
@@ -538,7 +538,7 @@ public function testSaveAndReplaceAdvancedPricesReplaceBehaviourInternalCalls()
538538
AdvancedPricing::TABLE_TIER_PRICE
539539
]
540540
)
541-
->will($this->returnSelf());
541+
->willReturnSelf();
542542

543543
$this->invokeMethod($this->advancedPricing, 'saveAndReplaceAdvancedPrices');
544544
}
@@ -567,7 +567,7 @@ public function testDeleteAdvancedPricingFormListSkuToDelete()
567567
->method('deleteProductTierPrices')
568568
->withConsecutive(
569569
[$expectedSkuList, AdvancedPricing::TABLE_TIER_PRICE]
570-
)->will($this->returnSelf());
570+
)->willReturnSelf();
571571

572572
$this->advancedPricing->deleteAdvancedPricing();
573573
}

app/code/Magento/AdvancedSearch/Test/Unit/Controller/Adminhtml/Search/System/Config/TestConnectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ protected function setUp(): void
9393
->setMethods(['create'])
9494
->getMock();
9595

96-
$this->clientMock = $this->createMock(ClientInterface::class);
96+
$this->clientMock = $this->getMockForAbstractClass(ClientInterface::class);
9797

9898
$this->resultJsonMock = $this->getMockBuilder(Json::class)
9999
->disableOriginalConstructor()

app/code/Magento/AdvancedSearch/Test/Unit/Model/Client/ClientResolverTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function setUp(): void
4545
$this->engineResolverMock = $this->getMockBuilder(EngineResolverInterface::class)
4646
->getMockForAbstractClass();
4747

48-
$this->objectManager = $this->createMock(ObjectManagerInterface::class);
48+
$this->objectManager = $this->getMockForAbstractClass(ObjectManagerInterface::class);
4949

5050
$this->model = new ClientResolver(
5151
$this->objectManager,
@@ -60,11 +60,11 @@ public function testCreate(): void
6060
$this->engineResolverMock->expects($this->once())->method('getCurrentSearchEngine')
6161
->willReturn('engineName');
6262

63-
$factoryMock = $this->createMock(ClientFactoryInterface::class);
63+
$factoryMock = $this->getMockForAbstractClass(ClientFactoryInterface::class);
6464

65-
$clientMock = $this->createMock(ClientInterface::class);
65+
$clientMock = $this->getMockForAbstractClass(ClientInterface::class);
6666

67-
$clientOptionsMock = $this->createMock(ClientOptionsInterface::class);
67+
$clientOptionsMock = $this->getMockForAbstractClass(ClientOptionsInterface::class);
6868

6969
$this->objectManager->expects($this->exactly(2))->method('create')
7070
->withConsecutive(

app/code/Magento/AdvancedSearch/Test/Unit/Model/Indexer/Fulltext/Plugin/CustomerGroupTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function testAroundSave(
100100
): void {
101101
$this->engineResolverMock->expects($this->once())
102102
->method('getCurrentSearchEngine')
103-
->will($this->returnValue($searchEngine));
103+
->willReturn($searchEngine);
104104

105105
$groupMock = $this->createPartialMock(
106106
CustomerGroupModel::class,
@@ -121,7 +121,7 @@ public function testAroundSave(
121121
$this->indexerRegistryMock->expects($this->exactly($invalidateCounter))
122122
->method('get')
123123
->with(FulltextIndexer::INDEXER_ID)
124-
->will($this->returnValue($this->indexerMock));
124+
->willReturn($this->indexerMock);
125125

126126
$this->assertEquals(
127127
$this->subjectMock,

app/code/Magento/AdvancedSearch/Test/Unit/Model/Recommendations/DataProviderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class DataProviderTest extends TestCase
7777
*/
7878
protected function setUp(): void
7979
{
80-
$this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class);
80+
$this->scopeConfigMock = $this->getMockForAbstractClass(ScopeConfigInterface::class);
8181
$this->layerResolverMock = $this->getMockBuilder(Resolver::class)
8282
->disableOriginalConstructor()
8383
->setMethods(['get'])
@@ -123,7 +123,7 @@ public function testGetItemsWhenDisabledSearchRecommendations(): void
123123
$isEnabledSearchRecommendations = false;
124124

125125
/** @var QueryInterface $queryInterfaceMock */
126-
$queryInterfaceMock = $this->createMock(QueryInterface::class);
126+
$queryInterfaceMock = $this->getMockForAbstractClass(QueryInterface::class);
127127

128128
$this->scopeConfigMock->expects($this->any())
129129
->method('isSetFlag')
@@ -147,7 +147,7 @@ public function testGetItemsWhenEnabledSearchRecommendations(): void
147147
$queryText = 'test';
148148

149149
/** @var QueryInterface $queryInterfaceMock */
150-
$queryInterfaceMock = $this->createMock(QueryInterface::class);
150+
$queryInterfaceMock = $this->getMockForAbstractClass(QueryInterface::class);
151151
$queryInterfaceMock->expects($this->any())->method('getQueryText')->willReturn($queryText);
152152

153153
$this->scopeConfigMock->expects($this->any())

0 commit comments

Comments
 (0)