Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
StoreConfigurationDataMapperTest.php
Go to the documentation of this file.
1 <?php
8 
9 use \Magento\Setup\Model\StoreConfigurationDataMapper;
10 
16 
17 class StoreConfigurationDataMapperTest extends \PHPUnit\Framework\TestCase
18 {
24  public function testGetConfigData(array $data, array $expected)
25  {
26  $userConfigurationDataMapper = new StoreConfigurationDataMapper();
27  $this->assertEquals($expected, $userConfigurationDataMapper->getConfigData($data));
28  }
29 
35  public function getConfigDataDataProvider()
36  {
37  return [
38  'valid' =>
39  [
40  [
42  StoreConfigurationDataMapper::KEY_BASE_URL => 'http://127.0.0.1/',
48  StoreConfigurationDataMapper::KEY_TIMEZONE => 'America/Chicago',
50  ],
51  [
53  Store::XML_PATH_UNSECURE_BASE_URL => 'http://127.0.0.1/',
55  Store::XML_PATH_SECURE_BASE_URL => 'https://127.0.0.1/',
58  Data::XML_PATH_DEFAULT_TIMEZONE => 'America/Chicago',
63  ],
64  ],
65  'valid alphabet url' => [
66  [
68  StoreConfigurationDataMapper::KEY_BASE_URL => 'http://example.com/',
69  StoreConfigurationDataMapper::KEY_BASE_URL_SECURE => 'https://example.com/',
74  StoreConfigurationDataMapper::KEY_TIMEZONE => 'America/Chicago',
76  ],
77  [
79  Store::XML_PATH_UNSECURE_BASE_URL => 'http://example.com/',
81  Store::XML_PATH_SECURE_BASE_URL => 'https://example.com/',
84  Data::XML_PATH_DEFAULT_TIMEZONE => 'America/Chicago',
89  ],
90  ],
91  'no trailing slash' =>
92  [
93  [
95  StoreConfigurationDataMapper::KEY_BASE_URL => 'http://127.0.0.1',
101  StoreConfigurationDataMapper::KEY_TIMEZONE => 'America/Chicago',
103  ],
104  [
106  Store::XML_PATH_UNSECURE_BASE_URL => 'http://127.0.0.1/',
108  Store::XML_PATH_SECURE_BASE_URL => 'https://127.0.0.1/',
111  Data::XML_PATH_DEFAULT_TIMEZONE => 'America/Chicago',
116  ],
117  ],
118  'no trailing slash, alphabet url' =>
119  [
120  [
122  StoreConfigurationDataMapper::KEY_BASE_URL => 'http://example.com',
123  StoreConfigurationDataMapper::KEY_BASE_URL_SECURE => 'https://example.com',
128  StoreConfigurationDataMapper::KEY_TIMEZONE => 'America/Chicago',
130  ],
131  [
133  Store::XML_PATH_UNSECURE_BASE_URL => 'http://example.com/',
135  Store::XML_PATH_SECURE_BASE_URL => 'https://example.com/',
138  Data::XML_PATH_DEFAULT_TIMEZONE => 'America/Chicago',
143  ],
144  ],
145  ];
146  }
147 }
const XML_PATH_UNSECURE_BASE_URL
Definition: Store.php:66
const XML_PATH_SECURE_IN_FRONTEND
Definition: Store.php:70
const XML_PATH_USE_SECURE_KEY
Definition: Url.php:26
const XML_PATH_SECURE_BASE_URL
Definition: Store.php:68
const XML_PATH_SECURE_IN_ADMINHTML
Definition: Store.php:72