Skip to content

Commit e82d61c

Browse files
Merge pull request #63 from magento-cia/cia-2.4.8-beta2-develop-2.4-develop-sync-11232024
Cia 2.4.8 beta2 develop 2.4 develop sync 11232024
2 parents 1029616 + c723c46 commit e82d61c

File tree

13 files changed

+68
-47
lines changed

13 files changed

+68
-47
lines changed

AdminAdobeIms/Test/Unit/Command/AdminAdobeImsEnableCommandTest.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
3+
* Copyright 2024 Adobe
4+
* All rights reserved.
45
* See COPYING.txt for license details.
56
*/
67

@@ -157,36 +158,36 @@ public function testAdminAdobeImsModuleEnableWillClearCacheWhenSuccessful(
157158
*
158159
* @return array[]
159160
*/
160-
public function cliCommandProvider(): array
161+
public static function cliCommandProvider(): array
161162
{
162163
return [
163164
[
164165
true,
165-
$this->once(),
166-
$this->once(),
166+
self::once(),
167+
self::once(),
167168
'Admin Adobe IMS integration is enabled',
168169
true
169170
],
170171
[
171172
false,
172-
$this->never(),
173-
$this->never(),
173+
self::never(),
174+
self::never(),
174175
'<error>The Client ID, Client Secret, Organization ID and 2FA are required ' .
175176
'when enabling the Admin Adobe IMS Module</error>',
176177
true
177178
],
178179
[
179180
true,
180-
$this->never(),
181-
$this->never(),
181+
self::never(),
182+
self::never(),
182183
'<error>The Client ID, Client Secret, Organization ID and 2FA are required ' .
183184
'when enabling the Admin Adobe IMS Module</error>',
184185
false
185186
],
186187
[
187188
false,
188-
$this->never(),
189-
$this->never(),
189+
self::never(),
190+
self::never(),
190191
'<error>The Client ID, Client Secret, Organization ID and 2FA are required ' .
191192
'when enabling the Admin Adobe IMS Module</error>',
192193
false

AdminAdobeIms/Test/Unit/Plugin/Block/Adminhtml/SignInPluginTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
3+
* Copyright 2024 Adobe
4+
* All rights reserved.
45
* See COPYING.txt for license details.
56
*/
67
declare(strict_types=1);
@@ -138,7 +139,7 @@ public function testAroundGetComponentJsonConfig(
138139
* @param array $userData
139140
* @return array
140141
*/
141-
private function getDefaultComponentConfig(array $userData): array
142+
private static function getDefaultComponentConfig(array $userData): array
142143
{
143144
return [
144145
'component' => 'Magento_AdobeIms/js/signIn',
@@ -163,7 +164,7 @@ private function getDefaultComponentConfig(array $userData): array
163164
/**
164165
* @return array
165166
*/
166-
public function userDataProvider(): array
167+
public static function userDataProvider(): array
167168
{
168169
return [
169170
'Existing authorized user' => [
@@ -173,7 +174,7 @@ public function userDataProvider(): array
173174
'email' => 'john@email.com',
174175
],
175176
[],
176-
$this->getDefaultComponentConfig([
177+
self::getDefaultComponentConfig([
177178
'isAuthorized' => true,
178179
'name' => 'John Doe',
179180
'email' => 'john@email.com',
@@ -189,7 +190,7 @@ public function userDataProvider(): array
189190
'image' => 'image.png'
190191
],
191192
[],
192-
$this->getDefaultComponentConfig($this->getDefaultUserData()),
193+
self::getDefaultComponentConfig(self::getDefaultUserData()),
193194
false
194195
],
195196
];
@@ -200,7 +201,7 @@ public function userDataProvider(): array
200201
*
201202
* @return array
202203
*/
203-
private function getDefaultUserData(): array
204+
private static function getDefaultUserData(): array
204205
{
205206
return [
206207
'isAuthorized' => false,

AdminAdobeIms/Test/Unit/Service/ImsCommandOptionServiceTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
3+
* Copyright 2024 Adobe
4+
* All rights reserved.
45
* See COPYING.txt for license details.
56
*/
67

@@ -255,7 +256,7 @@ public function executeGetOption($argument, $helperMock): ?string
255256
*
256257
* @return string[][]
257258
*/
258-
public function validInput(): array
259+
public static function validInput(): array
259260
{
260261
return [
261262
[
@@ -290,7 +291,7 @@ public function validInput(): array
290291
*
291292
* @return string[][]
292293
*/
293-
public function invalidInput(): array
294+
public static function invalidInput(): array
294295
{
295296
return [
296297
[

AdminAdobeIms/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"sort-packages": true
66
},
77
"require": {
8-
"php": "~8.1.0||~8.2.0||~8.3.0",
8+
"php": "~8.2.0||~8.3.0",
99
"magento/framework": "*",
1010
"magento/module-adobe-ims": "*",
1111
"magento/module-adobe-ims-api": "*",

AdminAdobeImsTwoFactorAuth/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/module-admin-adobe-ims-two-factor-auth",
33
"description": "This module is used to add Admin Adobe Ims and Two Factor Auth dependency.",
44
"require": {
5-
"php": "~8.1.0||~8.2.0||~8.3.0",
5+
"php": "~8.2.0||~8.3.0",
66
"magento/framework": "*",
77
"magento/module-admin-adobe-ims": "*",
88
"magento/module-two-factor-auth": "*"

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

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
3+
* Copyright 2024 Adobe
4+
* All rights reserved.
45
* See COPYING.txt for license details.
56
*/
67
declare(strict_types=1);
@@ -15,7 +16,9 @@
1516
use Magento\AdobeImsApi\Api\UserProfileRepositoryInterface;
1617
use Magento\Authorization\Model\UserContextInterface;
1718
use Magento\Backend\Block\Template\Context;
19+
use Magento\Directory\Helper\Data as DirectoryHelper;
1820
use Magento\Framework\Exception\NoSuchEntityException;
21+
use Magento\Framework\Json\Helper\Data as JsonHelper;
1922
use Magento\Framework\Serialize\Serializer\JsonHexTag;
2023
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
2124
use Magento\Framework\UrlInterface;
@@ -85,6 +88,17 @@ protected function setUp(): void
8588
$this->jsonHexTag = $this->createMock(JsonHexTag::class);
8689

8790
$objectManager = new ObjectManager($this);
91+
$objects = [
92+
[
93+
JsonHelper::class,
94+
$this->createMock(JsonHelper::class)
95+
],
96+
[
97+
DirectoryHelper::class,
98+
$this->createMock(DirectoryHelper::class)
99+
]
100+
];
101+
$objectManager->prepareObjectManager($objects);
88102
$this->signInBlock = $objectManager->getObject(
89103
SignInBlock::class,
90104
[
@@ -155,7 +169,7 @@ public function testGetComponentJsonConfig(
155169
* @param array $userData
156170
* @return array
157171
*/
158-
private function getDefaultComponentConfig(array $userData): array
172+
private static function getDefaultComponentConfig(array $userData): array
159173
{
160174
return [
161175
'component' => 'Magento_AdobeIms/js/signIn',
@@ -182,7 +196,7 @@ private function getDefaultComponentConfig(array $userData): array
182196
*
183197
* @return array
184198
*/
185-
private function getConfigProvideConfig(): array
199+
private static function getConfigProvideConfig(): array
186200
{
187201
return [
188202
'component' => 'Magento_AdobeIms/js/test',
@@ -208,7 +222,7 @@ private function getConfigProvideConfig(): array
208222
*
209223
* @return array
210224
*/
211-
private function getDefaultUserData(): array
225+
private static function getDefaultUserData(): array
212226
{
213227
return [
214228
'isAuthorized' => false,
@@ -221,7 +235,7 @@ private function getDefaultUserData(): array
221235
/**
222236
* @return array
223237
*/
224-
public function userDataProvider(): array
238+
public static function userDataProvider(): array
225239
{
226240
return [
227241
'Existing authorized user' => [
@@ -234,7 +248,7 @@ public function userDataProvider(): array
234248
'image' => 'image.png'
235249
],
236250
[],
237-
$this->getDefaultComponentConfig([
251+
self::getDefaultComponentConfig([
238252
'isAuthorized' => true,
239253
'name' => 'John',
240254
'email' => 'john@email.com',
@@ -251,7 +265,7 @@ public function userDataProvider(): array
251265
'image' => 'image.png'
252266
],
253267
[],
254-
$this->getDefaultComponentConfig($this->getDefaultUserData()),
268+
self::getDefaultComponentConfig(self::getDefaultUserData()),
255269
],
256270
'Non-existing user' => [
257271
13,
@@ -263,7 +277,7 @@ public function userDataProvider(): array
263277
'image' => 'image.png'
264278
],
265279
[],
266-
$this->getDefaultComponentConfig($this->getDefaultUserData()),
280+
self::getDefaultComponentConfig(self::getDefaultUserData()),
267281
],
268282
'Existing user with additional config provider' => [
269283
14,
@@ -274,10 +288,10 @@ public function userDataProvider(): array
274288
'email' => 'john@email.com',
275289
'image' => 'image.png'
276290
],
277-
$this->getConfigProvideConfig(),
291+
self::getConfigProvideConfig(),
278292
array_replace_recursive(
279-
$this->getDefaultComponentConfig($this->getDefaultUserData()),
280-
$this->getConfigProvideConfig()
293+
self::getDefaultComponentConfig(self::getDefaultUserData()),
294+
self::getConfigProvideConfig()
281295
)
282296
]
283297
];

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
3+
* Copyright 2024 Adobe
4+
* All rights reserved.
45
* See COPYING.txt for license details.
56
*/
67

@@ -134,7 +135,7 @@ public function testExecuteWithExecption(): void
134135
*
135136
* @return array
136137
*/
137-
public function userDataProvider(): array
138+
public static function userDataProvider(): array
138139
{
139140
return
140141
[

AdobeIms/Test/Unit/Model/GetAccessTokenTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
3+
* Copyright 2024 Adobe
4+
* All rights reserved.
45
* See COPYING.txt for license details.
56
*/
67
declare(strict_types=1);
@@ -100,15 +101,15 @@ public function testExecuteWIthException(): void
100101
*
101102
* @return array
102103
*/
103-
public function expectedDataProvider(): array
104+
public static function expectedDataProvider(): array
104105
{
105106
return
106107
[
107108
[
108109
'token' => 'kladjflakdjf3423rfzddsf'
109110
],
110111
[
111-
'null_token' => null
112+
'token' => null
112113
]
113114
];
114115
}

AdobeIms/Test/Unit/Model/GetImageTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
3+
* Copyright 2024 Adobe
4+
* All rights reserved.
45
* See COPYING.txt for license details.
56
*/
67
declare(strict_types=1);
@@ -112,11 +113,11 @@ public function testGetImageWithException(): void
112113
*
113114
* @return array
114115
*/
115-
public function imagesDataProvider(): array
116+
public static function imagesDataProvider(): array
116117
{
117118
return [
118119
[
119-
'expected_result' => [
120+
'expectedResult' => [
120121
'user' => [
121122
'images' => [
122123
50 => 'https://mir-s3-cdn-cf.behance.net/user/50/61269e393218159.5d8e3b72bcfb9.jpg',
@@ -129,7 +130,7 @@ public function imagesDataProvider(): array
129130
],
130131
'http_code' => 200,
131132
],
132-
'expected_image_url' => 'https://mir-s3-cdn-cf.behance.net/user/276/61269e393218159.5d8e3b72bcfb9.jpg'
133+
'expectedImageUrl' => 'https://mir-s3-cdn-cf.behance.net/user/276/61269e393218159.5d8e3b72bcfb9.jpg'
133134
]
134135
];
135136
}

AdobeIms/Test/Unit/Model/LoginTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
22
declare(strict_types=1);
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
4+
* Copyright 2024 Adobe
5+
* All rights reserved.
56
* See COPYING.txt for license details.
67
*/
78

@@ -179,13 +180,13 @@ public function testExecute(
179180
*
180181
* @return array
181182
*/
182-
public function responseDataProvider(): array
183+
public static function responseDataProvider(): array
183184
{
184185
return
185186
[
186187
[
187188
'userId' => 10,
188-
'tokenResponse' => [
189+
'responseData' => [
189190
'name' => 'Test User',
190191
'email' => 'user@test.com',
191192
'access_token' => 'kladjflakdjf3423rfzddsf',

0 commit comments

Comments
 (0)