Skip to content

Commit 4c6d65c

Browse files
committed
AC-15399::[CE] PHPUnit 12: Upgrade Wishlist & Rating related test | Refactoring
1 parent 2606d7e commit 4c6d65c

File tree

16 files changed

+44
-320
lines changed

16 files changed

+44
-320
lines changed

app/code/Magento/CatalogGraphQl/Test/Unit/Model/Resolver/Product/MediaGalleryTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Magento\CatalogGraphQl\Model\Resolver\Product\MediaGallery;
1414
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
1515
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
16-
use PHPUnit\Framework\Attributes\DataProvider;
1716
use PHPUnit\Framework\MockObject\MockObject;
1817
use PHPUnit\Framework\TestCase;
1918
use Magento\Framework\GraphQl\Config\Element\Field;
@@ -48,7 +47,7 @@ class MediaGalleryTest extends TestCase
4847
protected function setUp(): void
4948
{
5049
$this->fieldMock = $this->createMock(Field::class);
51-
$this->contextMock = $this->createMock(ContextInterface::class);
50+
$this->contextMock = $this->getMockForAbstractClass(ContextInterface::class);
5251
$this->infoMock = $this->createMock(ResolveInfo::class);
5352
$this->productMock = $this->getMockBuilder(Product::class)
5453
->disableOriginalConstructor()
@@ -57,12 +56,12 @@ protected function setUp(): void
5756
}
5857

5958
/**
59+
* @dataProvider dataProviderForResolve
6060
* @param $expected
6161
* @param $productName
6262
* @return void
6363
* @throws Exception
6464
*/
65-
#[DataProvider('dataProviderForResolve')]
6665
public function testResolve($expected, $productName): void
6766
{
6867
$existingEntryMock = $this->getMockBuilder(Entry::class)

app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionDuringMediaAssetInitializationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class GetByIdExceptionDuringMediaAssetInitializationTest extends TestCase
7070
protected function setUp(): void
7171
{
7272
$resourceConnection = $this->createMock(ResourceConnection::class);
73-
$this->assetFactory = $this->createMock(AssetInterfaceFactory::class); // @phpstan-ignore-line
73+
$this->assetFactory = $this->createMock(AssetInterfaceFactory::class);
7474
$this->logger = $this->createMock(LoggerInterface::class);
7575

7676
$this->getMediaAssetById = (new ObjectManager($this))->getObject(

app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionNoSuchEntityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class GetByIdExceptionNoSuchEntityTest extends TestCase
5757
protected function setUp(): void
5858
{
5959
$resourceConnection = $this->createMock(ResourceConnection::class);
60-
$this->assetFactory = $this->createMock(AssetInterfaceFactory::class); // @phpstan-ignore-line
60+
$this->assetFactory = $this->createMock(AssetInterfaceFactory::class);
6161
$logger = $this->createMock(LoggerInterface::class);
6262

6363
$this->getMediaAssetById = (new ObjectManager($this))->getObject(

app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdExceptionOnGetDataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class GetByIdExceptionOnGetDataTest extends TestCase
7070
protected function setUp(): void
7171
{
7272
$resourceConnection = $this->createMock(ResourceConnection::class);
73-
$assetFactory = $this->createMock(AssetInterfaceFactory::class); // @phpstan-ignore-line
73+
$assetFactory = $this->createMock(AssetInterfaceFactory::class);
7474
$this->logger = $this->createMock(LoggerInterface::class);
7575

7676
$this->getMediaAssetById = (new ObjectManager($this))->getObject(

app/code/Magento/MediaGallery/Test/Unit/Model/Asset/Command/GetByIdSuccessfulTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class GetByIdSuccessfulTest extends TestCase
7171
protected function setUp(): void
7272
{
7373
$resourceConnection = $this->createMock(ResourceConnection::class);
74-
$this->assetFactory = $this->createMock(AssetInterfaceFactory::class); // @phpstan-ignore-line
74+
$this->assetFactory = $this->createMock(AssetInterfaceFactory::class);
7575
$logger = $this->createMock(LoggerInterface::class);
7676

7777
$this->getMediaAssetById = (new ObjectManager($this))->getObject(

app/code/Magento/MediaGallery/Test/Unit/Model/Keyword/Command/GetAssetKeywordsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class GetAssetKeywordsTest extends TestCase
4444
protected function setUp(): void
4545
{
4646
$this->resourceConnectionStub = $this->createMock(ResourceConnection::class);
47-
$this->assetKeywordFactoryStub = $this->createMock(KeywordInterfaceFactory::class); // @phpstan-ignore-line
47+
$this->assetKeywordFactoryStub = $this->createMock(KeywordInterfaceFactory::class);
4848
$this->loggerMock = $this->createMock(LoggerInterface::class);
4949

5050
$this->sut = new GetAssetKeywords(

app/code/Magento/MediaGalleryUi/Test/Unit/Model/ConfigTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright 2018 Adobe
4-
* All Rights Reserved.
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
55
*/
66
declare(strict_types=1);
77

app/code/Magento/MediaStorage/Test/Unit/Helper/DatabaseTestHelper.php

Lines changed: 0 additions & 91 deletions
This file was deleted.

app/code/Magento/MediaStorage/Test/Unit/Helper/DirectoryDatabaseTestHelper.php

Lines changed: 0 additions & 98 deletions
This file was deleted.

app/code/Magento/MediaStorage/Test/Unit/Model/Asset/Plugin/CleanMergedJsCssTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright 2018 Adobe
4-
* All Rights Reserved.
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
55
*/
66
declare(strict_types=1);
77

0 commit comments

Comments
 (0)