Skip to content

Commit 087ccf3

Browse files
committed
Merge branch 'ACP2E-3734' of https://github.com/adobe-commerce-tier-4/magento2ce into PR-03-17-2025
2 parents 9baed86 + b9bb79d commit 087ccf3

File tree

2 files changed

+42
-17
lines changed

2 files changed

+42
-17
lines changed

app/code/Magento/RemoteStorage/Setup/ConfigOptionsList.php

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

@@ -38,7 +38,7 @@ class ConfigOptionsList implements ConfigOptionsListInterface
3838
private const OPTION_REMOTE_STORAGE_SECRET_KEY = 'remote-storage-secret';
3939
private const CONFIG_PATH__REMOTE_STORAGE_SECRET_KEY = RemoteDriverPool::PATH_CONFIG . '/credentials/secret';
4040
private const OPTION_REMOTE_STORAGE_PATH_STYLE = 'remote-storage-path-style';
41-
private const CONFIG_PATH__REMOTE_STORAGE_PATH_STYLE = RemoteDriverPool::PATH_CONFIG . '/path-style';
41+
private const CONFIG_PATH__REMOTE_STORAGE_PATH_STYLE = RemoteDriverPool::PATH_CONFIG . '/path_style';
4242

4343
/**
4444
* Map of option to config path relations.
@@ -129,7 +129,7 @@ public function getOptions(): array
129129
),
130130
new TextConfigOption(
131131
self::OPTION_REMOTE_STORAGE_PATH_STYLE,
132-
TextConfigOption::FRONTEND_WIZARD_PASSWORD,
132+
TextConfigOption::FRONTEND_WIZARD_TEXT,
133133
self::CONFIG_PATH__REMOTE_STORAGE_PATH_STYLE,
134134
'Remote storage path style',
135135
'0'

app/code/Magento/RemoteStorage/Test/Unit/Setup/ConfigOptionsListTest.php

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

78
namespace Magento\RemoteStorage\Test\Unit\Setup;
89

@@ -33,19 +34,10 @@ class ConfigOptionsListTest extends TestCase
3334
*/
3435
private $configOptionsList;
3536

36-
/**
37-
* @return void
38-
* @throws \Magento\Framework\Exception\FileSystemException
39-
*/
4037
protected function setUp(): void
4138
{
42-
$this->driverFactoryPoolMock = $this->getMockBuilder(DriverFactoryPool::class)
43-
->disableOriginalConstructor()
44-
->getMock();
45-
46-
$this->loggerMock = $this->getMockBuilder(LoggerInterface::class)
47-
->disableOriginalConstructor()
48-
->getMock();
39+
$this->driverFactoryPoolMock = $this->createMock(DriverFactoryPool::class);
40+
$this->loggerMock = $this->createMock(LoggerInterface::class);
4941

5042
$this->configOptionsList = new ConfigOptionsList(
5143
$this->driverFactoryPoolMock,
@@ -299,4 +291,37 @@ public static function createConfigProvider()
299291
],
300292
];
301293
}
294+
295+
/**
296+
* @dataProvider getOptionsProvider
297+
* @param string $name
298+
* @param string $configPath
299+
* @return void
300+
*/
301+
public function testGetOptions(string $name, string $configPath): void
302+
{
303+
$options = $this->configOptionsList->getOptions();
304+
$optionsMap = array_merge(
305+
...array_map(fn ($o) => [$o->getName() => $o->getConfigPath()], $options)
306+
);
307+
$this->assertArrayHasKey($name, $optionsMap);
308+
$this->assertEquals($configPath, $optionsMap[$name]);
309+
}
310+
311+
/**
312+
* @return array[]
313+
*/
314+
public static function getOptionsProvider(): array
315+
{
316+
return [
317+
['remote-storage-driver', 'remote_storage/driver'],
318+
['remote-storage-prefix', 'remote_storage/prefix'],
319+
['remote-storage-endpoint', 'remote_storage/config/endpoint'],
320+
['remote-storage-bucket', 'remote_storage/config/bucket'],
321+
['remote-storage-region', 'remote_storage/config/region'],
322+
['remote-storage-key', 'remote_storage/config/credentials/key'],
323+
['remote-storage-secret', 'remote_storage/config/credentials/secret'],
324+
['remote-storage-path-style', 'remote_storage/config/path_style'],
325+
];
326+
}
302327
}

0 commit comments

Comments
 (0)