Skip to content

Commit

Permalink
[90] [17] Read API :: Web-Api tests :: Magento\GraphQl\Catalog\MediaG…
Browse files Browse the repository at this point in the history
…alleryTest::testProductSmallImageUrlPlaceholder #90
  • Loading branch information
vzabaznov committed Jun 24, 2020
1 parent ce5757d commit 5ac2988
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
1 change: 1 addition & 0 deletions setup/src/Magento/Setup/Model/ConfigOptionsList.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class ConfigOptionsList implements ConfigOptionsListInterface
\Magento\Setup\Model\ConfigOptionsList\Cache::class,
\Magento\Setup\Model\ConfigOptionsList\PageCache::class,
\Magento\Setup\Model\ConfigOptionsList\Lock::class,
\Magento\Setup\Model\ConfigOptionsList\Directory::class,
];

/**
Expand Down
86 changes: 86 additions & 0 deletions setup/src/Magento/Setup/Model/ConfigOptionsList/Directory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\Setup\Model\ConfigOptionsList;

use Magento\Framework\App\DeploymentConfig;
use Magento\Framework\Config\Data\ConfigData;
use Magento\Framework\Config\File\ConfigFilePool;
use Magento\Framework\Setup\ConfigOptionsListInterface;
use Magento\Framework\Setup\Option\SelectConfigOption;

/**
* Deployment configuration options for the folders.
*/
class Directory implements ConfigOptionsListInterface
{
/**
* Input ket for config command.
*/
const INPUT_KEY_DOCUMENT_ROOT_IS_PUB = 'document-root-is-pub';

/**
* Path in in configuration.
*/
const CONFIG_PATH_DOCUMENT_ROOT_IS_PUB = 'directories/document_root_is_pub';

/**
* The available configuration values.
*
* @var array
*/
private $selectOptions = [true, false];

/**
* @param array $options
* @param DeploymentConfig $deploymentConfig
* @return ConfigData|ConfigData[]
*/
public function createConfig(array $options, DeploymentConfig $deploymentConfig)
{
$configData = new ConfigData(ConfigFilePool::APP_ENV);
if (isset($options[self::INPUT_KEY_DOCUMENT_ROOT_IS_PUB])) {
$configData->set(
self::CONFIG_PATH_DOCUMENT_ROOT_IS_PUB,
\filter_var($options[self::INPUT_KEY_DOCUMENT_ROOT_IS_PUB], FILTER_VALIDATE_BOOLEAN)
);
}

return $configData;
}

/**
* Return options from Directory configuration.
*
* @return \Magento\Framework\Setup\Option\AbstractConfigOption[]|SelectConfigOption[]
*/
public function getOptions()
{
return [
new SelectConfigOption(
self::INPUT_KEY_DOCUMENT_ROOT_IS_PUB,
SelectConfigOption::FRONTEND_WIZARD_SELECT,
$this->selectOptions,
self::CONFIG_PATH_DOCUMENT_ROOT_IS_PUB,
'Flag to show is Pub is on root, can be true or false only',
false
),
];
}

/**
* Validate options.
*
* @param array $options
* @param DeploymentConfig $deploymentConfig
* @return array|string[]
*/
public function validate(array $options, DeploymentConfig $deploymentConfig)
{
return [];
}
}

0 comments on commit 5ac2988

Please sign in to comment.