Skip to content

Commit d77a4c4

Browse files
committed
MC-38772: Apply automation to fix non-MFTF tests for MDEs
- Run automations
1 parent 1ce460f commit d77a4c4

File tree

54 files changed

+165
-165
lines changed

Some content is hidden

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

54 files changed

+165
-165
lines changed

AdobeIms/Test/Unit/Block/Adminhtml/SignInTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,20 @@ class SignInTest extends TestCase
8989
protected function setUp(): void
9090
{
9191
$this->objectManager = new ObjectManager($this);
92-
$urlBuilderMock = $this->createMock(UrlInterface::class);
92+
$urlBuilderMock = $this->getMockForAbstractClass(UrlInterface::class);
9393
$urlBuilderMock->expects($this->any())
9494
->method('getUrl')
9595
->willReturn(self::PROFILE_URL);
9696
$this->contextMock = $this->createMock(Context::class);
9797
$this->contextMock->expects($this->any())
9898
->method('getUrlBuilder')
9999
->willReturn($urlBuilderMock);
100-
$this->userAuthorizedMock = $this->createMock(UserAuthorizedInterface::class);
101-
$this->userProfileRepositoryMock = $this->createMock(UserProfileRepositoryInterface::class);
102-
$this->userContextMock = $this->createMock(UserContextInterface::class);
103-
$this->configMock = $this->createMock(ConfigInterface::class);
100+
$this->userAuthorizedMock = $this->getMockForAbstractClass(UserAuthorizedInterface::class);
101+
$this->userProfileRepositoryMock = $this->getMockForAbstractClass(UserProfileRepositoryInterface::class);
102+
$this->userContextMock = $this->getMockForAbstractClass(UserContextInterface::class);
103+
$this->configMock = $this->getMockForAbstractClass(ConfigInterface::class);
104104
$this->jsonHexTag = $this->objectManager->getObject(JsonHexTag::class);
105-
$this->configProviderMock = $this->createMock(ConfigProviderInterface::class);
105+
$this->configProviderMock = $this->getMockForAbstractClass(ConfigProviderInterface::class);
106106
$this->configMock->expects($this->once())
107107
->method('getAuthUrl')
108108
->willReturn(self::AUTH_URL);

AdobeIms/Test/Unit/Controller/Adminhtml/OAuth/CallbackTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ protected function setUp(): void
106106
);
107107
$this->userMock = $this->createMock(User::class);
108108
$this->request = $this->createMock(Http::class);
109-
$this->userProfileRepositoryInterface = $this->createMock(UserProfileRepositoryInterface::class);
109+
$this->userProfileRepositoryInterface = $this->getMockForAbstractClass(UserProfileRepositoryInterface::class);
110110
$this->userProfileInterfaceFactory = $this->createMock(UserProfileInterfaceFactory::class);
111-
$this->getTokenInterface = $this->createMock(GetTokenInterface::class);
112-
$this->logger = $this->createMock(LoggerInterface::class);
111+
$this->getTokenInterface = $this->getMockForAbstractClass(GetTokenInterface::class);
112+
$this->logger = $this->getMockForAbstractClass(LoggerInterface::class);
113113
$this->getImage = $this->createMock(GetImage::class);
114114
$this->callback = new Callback(
115115
$this->context,
@@ -127,10 +127,10 @@ protected function setUp(): void
127127
public function testExecute(): void
128128
{
129129
$this->authMock->method('getUser')
130-
->will($this->returnValue($this->userMock));
130+
->willReturn($this->userMock);
131131
$this->userMock->method('getId')
132132
->willReturn(1);
133-
$userProfileMock = $this->createMock(UserProfileInterface::class);
133+
$userProfileMock = $this->getMockForAbstractClass(UserProfileInterface::class);
134134
$this->getImage->expects($this->once())->method('execute')->willReturn('https://image.url/image.png');
135135
$this->userProfileRepositoryInterface->expects($this->exactly(1))
136136
->method('getByUserId')

AdobeIms/Test/Unit/Controller/Adminhtml/User/LogoutTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ class LogoutTest extends TestCase
5858
*/
5959
protected function setUp(): void
6060
{
61-
$this->logoutInterfaceMock = $this->createMock(LogOutInterface::class);
61+
$this->logoutInterfaceMock = $this->getMockForAbstractClass(LogOutInterface::class);
6262
$this->context = $this->createMock(ActionContext::class);
63-
$this->request = $this->createMock(RequestInterface::class);
63+
$this->request = $this->getMockForAbstractClass(RequestInterface::class);
6464
$this->resultFactory = $this->createMock(ResultFactory::class);
6565
$this->context->expects($this->once())
6666
->method('getResultFactory')

AdobeIms/Test/Unit/Controller/Adminhtml/User/ProfileTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ protected function setUp(): void
6969
{
7070
$this->action = $this->createMock(Context::class);
7171

72-
$this->userContext = $this->createMock(UserContextInterface::class);
73-
$this->userProfileRepository = $this->createMock(UserProfileRepositoryInterface::class);
74-
$this->logger = $this->createMock(LoggerInterface::class);
72+
$this->userContext = $this->getMockForAbstractClass(UserContextInterface::class);
73+
$this->userProfileRepository = $this->getMockForAbstractClass(UserProfileRepositoryInterface::class);
74+
$this->logger = $this->getMockForAbstractClass(LoggerInterface::class);
7575
$this->jsonObject = $this->createMock(Json::class);
7676
$this->resultFactory = $this->createMock(ResultFactory::class);
7777
$this->action->expects($this->once())
@@ -96,7 +96,7 @@ protected function setUp(): void
9696
public function testExecute(array $result): void
9797
{
9898
$this->userContext->expects($this->once())->method('getUserId')->willReturn(1);
99-
$userProfileMock = $this->createMock(UserProfileInterface::class);
99+
$userProfileMock = $this->getMockForAbstractClass(UserProfileInterface::class);
100100
$userProfileMock->expects($this->once())->method('getEmail')->willReturn('[email protected]');
101101
$userProfileMock->expects($this->once())->method('getName')->willReturn('Smith');
102102
$userProfileMock->expects($this->once())->method('getImage')->willReturn('https://adobe.com/sample-image.png');

AdobeIms/Test/Unit/Model/ConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ConfigTest extends TestCase
4141
protected function setUp(): void
4242
{
4343
$this->objectManager = new ObjectManager($this);
44-
$this->scopeConfigMock = $this->createMock(ScopeConfigInterface::class);
44+
$this->scopeConfigMock = $this->getMockForAbstractClass(ScopeConfigInterface::class);
4545
$this->config = $this->objectManager->getObject(
4646
Config::class,
4747
[

AdobeIms/Test/Unit/Model/FlushUserTokensTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class FlushUserTokensTest extends TestCase
4040
*/
4141
protected function setUp(): void
4242
{
43-
$this->userContext = $this->createMock(UserContextInterface::class);
44-
$this->userProfileRepository = $this->createMock(UserProfileRepositoryInterface::class);
43+
$this->userContext = $this->getMockForAbstractClass(UserContextInterface::class);
44+
$this->userProfileRepository = $this->getMockForAbstractClass(UserProfileRepositoryInterface::class);
4545

4646
$this->flushTokens = new FlushUserTokens(
4747
$this->userContext,
@@ -55,7 +55,7 @@ protected function setUp(): void
5555
public function testExecute(): void
5656
{
5757
$this->userContext->expects($this->once())->method('getUserId')->willReturn(1);
58-
$userProfileMock = $this->createMock(UserProfileInterface::class);
58+
$userProfileMock = $this->getMockForAbstractClass(UserProfileInterface::class);
5959
$this->userProfileRepository->expects($this->exactly(1))
6060
->method('getByUserId')
6161
->willReturn($userProfileMock);

AdobeIms/Test/Unit/Model/GetAccessTokenTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class GetAccessTokenTest extends TestCase
4141
*/
4242
protected function setUp(): void
4343
{
44-
$this->userContext = $this->createMock(UserContextInterface::class);
45-
$this->userProfile = $this->createMock(UserProfileRepositoryInterface::class);
44+
$this->userContext = $this->getMockForAbstractClass(UserContextInterface::class);
45+
$this->userProfile = $this->getMockForAbstractClass(UserProfileRepositoryInterface::class);
4646

4747
$this->getAccessToken = new GetAccessToken(
4848
$this->userContext,
@@ -59,7 +59,7 @@ protected function setUp(): void
5959
public function testExecute(?string $token): void
6060
{
6161
$this->userContext->expects($this->once())->method('getUserId')->willReturn(1);
62-
$userProfileMock = $this->createMock(UserProfileInterface::class);
62+
$userProfileMock = $this->getMockForAbstractClass(UserProfileInterface::class);
6363
$this->userProfile->expects($this->exactly(1))
6464
->method('getByUserId')
6565
->willReturn($userProfileMock);

AdobeIms/Test/Unit/Model/GetImageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ protected function setUp(): void
6060
$this->objectManager = new ObjectManager($this);
6161
$this->curlFactoryMock = $this->createMock(CurlFactory::class);
6262
$this->jsonMock = $this->createMock(Json::class);
63-
$this->logger = $this->createMock(LoggerInterface::class);
64-
$this->configInterface = $this->createMock(ConfigInterface::class);
63+
$this->logger = $this->getMockForAbstractClass(LoggerInterface::class);
64+
$this->configInterface = $this->getMockForAbstractClass(ConfigInterface::class);
6565

6666
$this->getImage = new GetImage(
6767
$this->logger,

AdobeIms/Test/Unit/Model/GetTokenTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ class GetTokenTest extends TestCase
6565
protected function setUp(): void
6666
{
6767
$this->objectManager = new ObjectManager($this);
68-
$this->configMock = $this->createMock(ConfigInterface::class);
68+
$this->configMock = $this->getMockForAbstractClass(ConfigInterface::class);
6969
$this->curlFactoryMock = $this->createMock(CurlFactory::class);
7070
$this->jsonMock = $this->createMock(Json::class);
7171
$this->tokenResponseFactoryMock = $this->createMock(TokenResponseInterfaceFactory::class);
72-
$this->url = $this->createMock(UrlInterface::class);
72+
$this->url = $this->getMockForAbstractClass(UrlInterface::class);
7373
$this->getToken = new GetToken(
7474
$this->configMock,
7575
$this->curlFactoryMock,

AdobeIms/Test/Unit/Model/LogOutTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ class LogOutTest extends TestCase
7676
protected function setUp(): void
7777
{
7878
$this->curlFactoryMock = $this->createMock(CurlFactory::class);
79-
$this->userProfileInterfaceMock = $this->createMock(UserProfileInterface::class);
80-
$this->userProfileRepositoryInterfaceMock = $this->createMock(UserProfileRepositoryInterface::class);
81-
$this->userContextInterfaceMock = $this->createMock(UserContextInterface::class);
82-
$this->configInterfaceMock = $this->createMock(ConfigInterface::class);
83-
$this->loggerInterfaceMock = $this->createMock(LoggerInterface::class);
79+
$this->userProfileInterfaceMock = $this->getMockForAbstractClass(UserProfileInterface::class);
80+
$this->userProfileRepositoryInterfaceMock = $this->getMockForAbstractClass(UserProfileRepositoryInterface::class);
81+
$this->userContextInterfaceMock = $this->getMockForAbstractClass(UserContextInterface::class);
82+
$this->configInterfaceMock = $this->getMockForAbstractClass(ConfigInterface::class);
83+
$this->loggerInterfaceMock = $this->getMockForAbstractClass(LoggerInterface::class);
8484
$this->model = new LogOut(
8585
$this->userContextInterfaceMock,
8686
$this->userProfileRepositoryInterfaceMock,
@@ -123,7 +123,7 @@ public function testExecute(): void
123123
$this->userProfileRepositoryInterfaceMock->expects($this->once())
124124
->method('save')
125125
->willReturn(null);
126-
$this->assertEquals(true, $this->model->execute());
126+
$this->assertTrue($this->model->execute());
127127
}
128128

129129
/**
@@ -154,7 +154,7 @@ public function testExecuteWithError(): void
154154
->willReturn(self::HTTP_ERROR);
155155
$this->loggerInterfaceMock->expects($this->once())
156156
->method('critical');
157-
$this->assertEquals(false, $this->model->execute());
157+
$this->assertFalse($this->model->execute());
158158
}
159159

160160
/**

0 commit comments

Comments
 (0)