@wordpress/env 5.16.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +189 -120
- package/lib/build-docker-compose-config.js +67 -96
- package/lib/cache.js +1 -0
- package/lib/cli.js +23 -3
- package/lib/commands/clean.js +14 -1
- package/lib/commands/destroy.js +12 -37
- package/lib/commands/index.js +1 -0
- package/lib/commands/install-path.js +1 -0
- package/lib/commands/logs.js +1 -0
- package/lib/commands/run.js +79 -15
- package/lib/commands/start.js +32 -10
- package/lib/commands/stop.js +1 -0
- package/lib/config/add-or-replace-port.js +41 -0
- package/lib/config/db-env.js +1 -0
- package/lib/config/detect-directory-type.js +1 -1
- package/lib/config/get-cache-directory.js +39 -0
- package/lib/config/get-config-from-environment-vars.js +86 -0
- package/lib/config/index.js +7 -5
- package/lib/config/load-config.js +92 -0
- package/lib/config/merge-configs.js +104 -0
- package/lib/config/parse-config.js +418 -157
- package/lib/config/parse-source-string.js +164 -0
- package/lib/config/post-process-config.js +202 -0
- package/lib/config/read-raw-config-file.js +7 -33
- package/lib/config/test/__snapshots__/config-integration.js.snap +271 -0
- package/lib/config/test/add-or-replace-port.js +81 -0
- package/lib/config/test/config-integration.js +143 -0
- package/lib/config/test/get-cache-directory.js +57 -0
- package/lib/config/test/merge-configs.js +111 -0
- package/lib/config/test/parse-config.js +342 -0
- package/lib/config/test/parse-source-string.js +154 -0
- package/lib/config/test/post-process-config.js +295 -0
- package/lib/config/test/read-raw-config-file.js +19 -63
- package/lib/config/test/validate-config.js +305 -0
- package/lib/config/validate-config.js +103 -40
- package/lib/env.js +2 -0
- package/lib/execute-after-setup.js +51 -0
- package/lib/get-host-user.js +31 -0
- package/lib/init-config.js +181 -63
- package/lib/md5.js +1 -0
- package/lib/parse-xdebug-mode.js +1 -0
- package/lib/retry.js +1 -0
- package/lib/test/__snapshots__/md5.js.snap +9 -0
- package/lib/test/build-docker-compose-config.js +134 -0
- package/lib/test/cache.js +154 -0
- package/lib/test/cli.js +149 -0
- package/lib/test/execute-after-setup.js +66 -0
- package/lib/test/md5.js +35 -0
- package/lib/test/parse-xdebug-mode.js +41 -0
- package/lib/wordpress.js +5 -33
- package/package.json +2 -2
- package/lib/config/config.js +0 -357
- package/lib/config/test/__snapshots__/config.js.snap +0 -83
- package/lib/config/test/config.js +0 -1203
package/lib/config/config.js
DELETED
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
/**
|
|
3
|
-
* External dependencies
|
|
4
|
-
*/
|
|
5
|
-
const fs = require( 'fs' ).promises;
|
|
6
|
-
const path = require( 'path' );
|
|
7
|
-
const os = require( 'os' );
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
|
-
const detectDirectoryType = require( './detect-directory-type' );
|
|
13
|
-
const { validateConfig, ValidationError } = require( './validate-config' );
|
|
14
|
-
const readRawConfigFile = require( './read-raw-config-file' );
|
|
15
|
-
const parseConfig = require( './parse-config' );
|
|
16
|
-
const { includeTestsPath, parseSourceString } = parseConfig;
|
|
17
|
-
const md5 = require( '../md5' );
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* wp-env configuration.
|
|
21
|
-
*
|
|
22
|
-
* @typedef WPConfig
|
|
23
|
-
* @property {string} name Name of the environment.
|
|
24
|
-
* @property {string} configDirectoryPath Path to the .wp-env.json file.
|
|
25
|
-
* @property {string} workDirectoryPath Path to the work directory located in ~/.wp-env.
|
|
26
|
-
* @property {string} dockerComposeConfigPath Path to the docker-compose.yml file.
|
|
27
|
-
* @property {boolean} detectedLocalConfig If true, wp-env detected local config and used it.
|
|
28
|
-
* @property {Object.<string, WPServiceConfig>} env Specific config for different environments.
|
|
29
|
-
* @property {boolean} debug True if debug mode is enabled.
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Base-level config for any particular environment. (development/tests/etc)
|
|
34
|
-
*
|
|
35
|
-
* @typedef WPServiceConfig
|
|
36
|
-
* @property {WPSource} coreSource The WordPress installation to load in the environment.
|
|
37
|
-
* @property {WPSource[]} pluginSources Plugins to load in the environment.
|
|
38
|
-
* @property {WPSource[]} themeSources Themes to load in the environment.
|
|
39
|
-
* @property {number} port The port to use.
|
|
40
|
-
* @property {Object} config Mapping of wp-config.php constants to their desired values.
|
|
41
|
-
* @property {Object.<string, WPSource>} mappings Mapping of WordPress directories to local directories which should be mounted.
|
|
42
|
-
* @property {string} phpVersion Version of PHP to use in the environments, of the format 0.0.
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* A WordPress installation, plugin or theme to be loaded into the environment.
|
|
47
|
-
*
|
|
48
|
-
* @typedef WPSource
|
|
49
|
-
* @property {'local'|'git'|'zip'} type The source type.
|
|
50
|
-
* @property {string} path The path to the WordPress installation, plugin or theme.
|
|
51
|
-
* @property {?string} url The URL to the source download if the source type is not local.
|
|
52
|
-
* @property {?string} ref The git ref for the source if the source type is 'git'.
|
|
53
|
-
* @property {string} basename Name that identifies the WordPress installation, plugin or theme.
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Reads, parses, and validates the given .wp-env.json file into a wp-env config
|
|
58
|
-
* object for internal use.
|
|
59
|
-
*
|
|
60
|
-
* @param {string} configPath Path to the .wp-env.json file.
|
|
61
|
-
*
|
|
62
|
-
* @return {WPConfig} A parsed and validated wp-env config object.
|
|
63
|
-
*/
|
|
64
|
-
module.exports = async function readConfig( configPath ) {
|
|
65
|
-
const configDirectoryPath = path.dirname( configPath );
|
|
66
|
-
const workDirectoryPath = path.resolve(
|
|
67
|
-
await getHomeDirectory(),
|
|
68
|
-
md5( configPath )
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
// The specified base configuration from .wp-env.json or from the local
|
|
72
|
-
// source type which was automatically detected.
|
|
73
|
-
const baseConfig =
|
|
74
|
-
( await readRawConfigFile( '.wp-env.json', configPath ) ) ||
|
|
75
|
-
( await getDefaultBaseConfig( configPath ) );
|
|
76
|
-
|
|
77
|
-
// Overriden .wp-env.json on a per-user case.
|
|
78
|
-
const overrideConfig =
|
|
79
|
-
( await readRawConfigFile(
|
|
80
|
-
'.wp-env.override.json',
|
|
81
|
-
configPath.replace( /\.wp-env\.json$/, '.wp-env.override.json' )
|
|
82
|
-
) ) || {};
|
|
83
|
-
|
|
84
|
-
const detectedLocalConfig =
|
|
85
|
-
Object.keys( { ...baseConfig, ...overrideConfig } ).length > 0;
|
|
86
|
-
|
|
87
|
-
// Default configuration which is overridden by .wp-env.json files.
|
|
88
|
-
const defaultConfiguration = {
|
|
89
|
-
core: null, // Indicates that the latest stable version should ultimately be used.
|
|
90
|
-
phpVersion: null,
|
|
91
|
-
plugins: [],
|
|
92
|
-
themes: [],
|
|
93
|
-
port: 8888,
|
|
94
|
-
mappings: {},
|
|
95
|
-
config: {
|
|
96
|
-
WP_DEBUG: true,
|
|
97
|
-
SCRIPT_DEBUG: true,
|
|
98
|
-
WP_ENVIRONMENT_TYPE: 'local',
|
|
99
|
-
WP_PHP_BINARY: 'php',
|
|
100
|
-
WP_TESTS_EMAIL: 'admin@example.org',
|
|
101
|
-
WP_TESTS_TITLE: 'Test Blog',
|
|
102
|
-
WP_TESTS_DOMAIN: 'localhost',
|
|
103
|
-
WP_SITEURL: 'http://localhost',
|
|
104
|
-
WP_HOME: 'http://localhost',
|
|
105
|
-
},
|
|
106
|
-
env: {
|
|
107
|
-
development: {}, // No overrides needed, but it should exist.
|
|
108
|
-
tests: {
|
|
109
|
-
config: { WP_DEBUG: false, SCRIPT_DEBUG: false },
|
|
110
|
-
port: 8889,
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
// A quick validation before merging on a service by service level allows us
|
|
116
|
-
// to check the root configuration options and provide more helpful errors.
|
|
117
|
-
validateConfig(
|
|
118
|
-
mergeWpServiceConfigs( [
|
|
119
|
-
defaultConfiguration,
|
|
120
|
-
baseConfig,
|
|
121
|
-
overrideConfig,
|
|
122
|
-
] )
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
// A unique array of the environments specified in the config options.
|
|
126
|
-
// Needed so that we can override settings per-environment, rather than
|
|
127
|
-
// overwriting each environment key.
|
|
128
|
-
const getEnvKeys = ( config ) => Object.keys( config.env || {} );
|
|
129
|
-
const allEnvs = [
|
|
130
|
-
...new Set( [
|
|
131
|
-
...getEnvKeys( defaultConfiguration ),
|
|
132
|
-
...getEnvKeys( baseConfig ),
|
|
133
|
-
...getEnvKeys( overrideConfig ),
|
|
134
|
-
] ),
|
|
135
|
-
];
|
|
136
|
-
|
|
137
|
-
// Returns a pair with the root config options and the specific environment config options.
|
|
138
|
-
const getEnvConfig = ( config, envName ) => [
|
|
139
|
-
config,
|
|
140
|
-
config.env && config.env[ envName ] ? config.env[ envName ] : {},
|
|
141
|
-
];
|
|
142
|
-
|
|
143
|
-
// Merge each of the specified environment-level overrides.
|
|
144
|
-
const allPorts = new Set(); // Keep track of unique ports for validation.
|
|
145
|
-
const env = {};
|
|
146
|
-
for ( const envName of allEnvs ) {
|
|
147
|
-
env[ envName ] = await parseConfig(
|
|
148
|
-
validateConfig(
|
|
149
|
-
mergeWpServiceConfigs( [
|
|
150
|
-
...getEnvConfig( defaultConfiguration, envName ),
|
|
151
|
-
...getEnvConfig( baseConfig, envName ),
|
|
152
|
-
...getEnvConfig( overrideConfig, envName ),
|
|
153
|
-
] ),
|
|
154
|
-
envName
|
|
155
|
-
),
|
|
156
|
-
{ workDirectoryPath }
|
|
157
|
-
);
|
|
158
|
-
allPorts.add( env[ envName ].port );
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if ( allPorts.size !== allEnvs.length ) {
|
|
162
|
-
throw new ValidationError(
|
|
163
|
-
'Invalid .wp-env.json: Each port value must be unique.'
|
|
164
|
-
);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return withOverrides( {
|
|
168
|
-
name: path.basename( configDirectoryPath ),
|
|
169
|
-
dockerComposeConfigPath: path.resolve(
|
|
170
|
-
workDirectoryPath,
|
|
171
|
-
'docker-compose.yml'
|
|
172
|
-
),
|
|
173
|
-
configDirectoryPath,
|
|
174
|
-
workDirectoryPath,
|
|
175
|
-
detectedLocalConfig,
|
|
176
|
-
env,
|
|
177
|
-
} );
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Deep-merges the values in the given service environment. This allows us to
|
|
182
|
-
* merge the wp-config.php values instead of overwriting them. Note that this
|
|
183
|
-
* merges configs before they have been validated, so the passed config shape
|
|
184
|
-
* will not match the WPServiceConfig type.
|
|
185
|
-
*
|
|
186
|
-
* @param {Object[]} configs Array of raw service config objects to merge.
|
|
187
|
-
*
|
|
188
|
-
* @return {Object} The merged configuration object.
|
|
189
|
-
*/
|
|
190
|
-
function mergeWpServiceConfigs( configs ) {
|
|
191
|
-
// Returns an array of nested values in the config object. For example,
|
|
192
|
-
// an array of all the wp-config objects.
|
|
193
|
-
const mergeNestedObjs = ( key ) =>
|
|
194
|
-
Object.assign(
|
|
195
|
-
{},
|
|
196
|
-
...configs.map( ( config ) => {
|
|
197
|
-
if ( ! config[ key ] ) {
|
|
198
|
-
return {};
|
|
199
|
-
} else if ( typeof config[ key ] === 'object' ) {
|
|
200
|
-
return config[ key ];
|
|
201
|
-
}
|
|
202
|
-
throw new ValidationError(
|
|
203
|
-
`Invalid .wp-env.json: "${ key }" must be an object.`
|
|
204
|
-
);
|
|
205
|
-
} )
|
|
206
|
-
);
|
|
207
|
-
|
|
208
|
-
const mergedConfig = {
|
|
209
|
-
...Object.assign( {}, ...configs ),
|
|
210
|
-
config: mergeNestedObjs( 'config' ),
|
|
211
|
-
mappings: mergeNestedObjs( 'mappings' ),
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
delete mergedConfig.env;
|
|
215
|
-
return mergedConfig;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Detects basic config options to use if the .wp-env.json config file does not
|
|
220
|
-
* exist. For example, if the local directory contains a plugin, that will be
|
|
221
|
-
* added to the default plugin sources.
|
|
222
|
-
*
|
|
223
|
-
* @param {string} configPath A path to the config file for the source to detect.
|
|
224
|
-
* @return {Object} Basic config options for the detected source type. Empty
|
|
225
|
-
* object if no config detected.
|
|
226
|
-
*/
|
|
227
|
-
async function getDefaultBaseConfig( configPath ) {
|
|
228
|
-
const configDirectoryPath = path.dirname( configPath );
|
|
229
|
-
const type = await detectDirectoryType( configDirectoryPath );
|
|
230
|
-
|
|
231
|
-
if ( type === 'core' ) {
|
|
232
|
-
return { core: '.' };
|
|
233
|
-
} else if ( type === 'plugin' ) {
|
|
234
|
-
return { plugins: [ '.' ] };
|
|
235
|
-
} else if ( type === 'theme' ) {
|
|
236
|
-
return { themes: [ '.' ] };
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
return {};
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Overrides keys in the config object with set environment variables or options
|
|
244
|
-
* which should be merged.
|
|
245
|
-
*
|
|
246
|
-
* @param {WPConfig} config fully parsed configuration object.
|
|
247
|
-
* @return {WPConfig} configuration object with overrides applied.
|
|
248
|
-
*/
|
|
249
|
-
function withOverrides( config ) {
|
|
250
|
-
const workDirectoryPath = config.workDirectoryPath;
|
|
251
|
-
// Override port numbers with environment variables.
|
|
252
|
-
config.env.development.port =
|
|
253
|
-
getNumberFromEnvVariable( 'WP_ENV_PORT' ) ||
|
|
254
|
-
config.env.development.port;
|
|
255
|
-
config.env.tests.port =
|
|
256
|
-
getNumberFromEnvVariable( 'WP_ENV_TESTS_PORT' ) ||
|
|
257
|
-
config.env.tests.port;
|
|
258
|
-
|
|
259
|
-
// Override WordPress core with environment variable.
|
|
260
|
-
if ( process.env.WP_ENV_CORE ) {
|
|
261
|
-
const coreSource = includeTestsPath(
|
|
262
|
-
parseSourceString( process.env.WP_ENV_CORE, { workDirectoryPath } ),
|
|
263
|
-
{ workDirectoryPath }
|
|
264
|
-
);
|
|
265
|
-
config.env.development.coreSource = coreSource;
|
|
266
|
-
config.env.tests.coreSource = coreSource;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// Override PHP version with environment variable.
|
|
270
|
-
config.env.development.phpVersion =
|
|
271
|
-
process.env.WP_ENV_PHP_VERSION || config.env.development.phpVersion;
|
|
272
|
-
config.env.tests.phpVersion =
|
|
273
|
-
process.env.WP_ENV_PHP_VERSION || config.env.tests.phpVersion;
|
|
274
|
-
|
|
275
|
-
const updateEnvUrl = ( configKey ) => {
|
|
276
|
-
[ 'development', 'tests' ].forEach( ( envKey ) => {
|
|
277
|
-
try {
|
|
278
|
-
const baseUrl = new URL(
|
|
279
|
-
config.env[ envKey ].config[ configKey ]
|
|
280
|
-
);
|
|
281
|
-
|
|
282
|
-
// Don't overwrite the port of WP_HOME when set.
|
|
283
|
-
if ( ! ( configKey === 'WP_HOME' && !! baseUrl.port ) ) {
|
|
284
|
-
baseUrl.port = config.env[ envKey ].port;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
config.env[ envKey ].config[ configKey ] = baseUrl.toString();
|
|
288
|
-
} catch ( error ) {
|
|
289
|
-
throw new ValidationError(
|
|
290
|
-
`Invalid .wp-env.json: config.${ configKey } must be a valid URL.`
|
|
291
|
-
);
|
|
292
|
-
}
|
|
293
|
-
} );
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
// Update wp config options to include the correct port number in the URL.
|
|
297
|
-
updateEnvUrl( 'WP_SITEURL' );
|
|
298
|
-
updateEnvUrl( 'WP_HOME' );
|
|
299
|
-
|
|
300
|
-
return config;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Parses an environment variable which should be a number.
|
|
305
|
-
*
|
|
306
|
-
* Throws an error if the variable cannot be parsed to a number.
|
|
307
|
-
* Returns null if the environment variable has not been specified.
|
|
308
|
-
*
|
|
309
|
-
* @param {string} varName The environment variable to check (e.g. WP_ENV_PORT).
|
|
310
|
-
* @return {null|number} The number. Null if it does not exist.
|
|
311
|
-
*/
|
|
312
|
-
function getNumberFromEnvVariable( varName ) {
|
|
313
|
-
// Allow use of the default if it does not exist.
|
|
314
|
-
if ( ! process.env[ varName ] ) {
|
|
315
|
-
return null;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
const maybeNumber = parseInt( process.env[ varName ] );
|
|
319
|
-
|
|
320
|
-
// Throw an error if it is not parseable as a number.
|
|
321
|
-
if ( isNaN( maybeNumber ) ) {
|
|
322
|
-
throw new ValidationError(
|
|
323
|
-
`Invalid environment variable: ${ varName } must be a number.`
|
|
324
|
-
);
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
return maybeNumber;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Gets the `wp-env` home directory in which generated files are created.
|
|
332
|
-
*
|
|
333
|
-
* By default: '~/.wp-env/'. On Linux with snap packages: '~/wp-env/'. Can be
|
|
334
|
-
* overridden with the WP_ENV_HOME environment variable.
|
|
335
|
-
*
|
|
336
|
-
* @return {Promise<string>} The absolute path to the `wp-env` home directory.
|
|
337
|
-
*/
|
|
338
|
-
async function getHomeDirectory() {
|
|
339
|
-
// Allow user to override download location.
|
|
340
|
-
if ( process.env.WP_ENV_HOME ) {
|
|
341
|
-
return path.resolve( process.env.WP_ENV_HOME );
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Installing docker with Snap Packages on Linux is common, but does not
|
|
346
|
-
* support hidden directories. Therefore we use a public directory when
|
|
347
|
-
* snap packages exist.
|
|
348
|
-
*
|
|
349
|
-
* @see https://github.com/WordPress/gutenberg/issues/20180#issuecomment-587046325
|
|
350
|
-
*/
|
|
351
|
-
return path.resolve(
|
|
352
|
-
os.homedir(),
|
|
353
|
-
!! ( await fs.stat( '/snap' ).catch( () => false ) )
|
|
354
|
-
? 'wp-env'
|
|
355
|
-
: '.wp-env'
|
|
356
|
-
);
|
|
357
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`readConfig config file should match snapshot 1`] = `
|
|
4
|
-
{
|
|
5
|
-
"configDirectoryPath": ".",
|
|
6
|
-
"detectedLocalConfig": true,
|
|
7
|
-
"env": {
|
|
8
|
-
"development": {
|
|
9
|
-
"config": {
|
|
10
|
-
"SCRIPT_DEBUG": true,
|
|
11
|
-
"TEST": 100,
|
|
12
|
-
"TEST_VAL1": 1,
|
|
13
|
-
"TEST_VAL2": "hello",
|
|
14
|
-
"TEST_VAL3": false,
|
|
15
|
-
"WP_DEBUG": true,
|
|
16
|
-
"WP_ENVIRONMENT_TYPE": "local",
|
|
17
|
-
"WP_HOME": "http://localhost:2000/",
|
|
18
|
-
"WP_PHP_BINARY": "php",
|
|
19
|
-
"WP_SITEURL": "http://localhost:2000/",
|
|
20
|
-
"WP_TESTS_DOMAIN": "localhost",
|
|
21
|
-
"WP_TESTS_EMAIL": "admin@example.org",
|
|
22
|
-
"WP_TESTS_TITLE": "Test Blog",
|
|
23
|
-
},
|
|
24
|
-
"mappings": {},
|
|
25
|
-
"phpVersion": null,
|
|
26
|
-
"pluginSources": [],
|
|
27
|
-
"port": 2000,
|
|
28
|
-
"themeSources": [],
|
|
29
|
-
},
|
|
30
|
-
"tests": {
|
|
31
|
-
"config": {
|
|
32
|
-
"SCRIPT_DEBUG": false,
|
|
33
|
-
"TEST": 200,
|
|
34
|
-
"TEST_VAL1": 1,
|
|
35
|
-
"TEST_VAL2": "hello",
|
|
36
|
-
"TEST_VAL3": false,
|
|
37
|
-
"WP_DEBUG": false,
|
|
38
|
-
"WP_ENVIRONMENT_TYPE": "local",
|
|
39
|
-
"WP_HOME": "http://localhost:1000/",
|
|
40
|
-
"WP_PHP_BINARY": "php",
|
|
41
|
-
"WP_SITEURL": "http://localhost:1000/",
|
|
42
|
-
"WP_TESTS_DOMAIN": "localhost",
|
|
43
|
-
"WP_TESTS_EMAIL": "admin@example.org",
|
|
44
|
-
"WP_TESTS_TITLE": "Test Blog",
|
|
45
|
-
},
|
|
46
|
-
"mappings": {},
|
|
47
|
-
"phpVersion": null,
|
|
48
|
-
"pluginSources": [],
|
|
49
|
-
"port": 1000,
|
|
50
|
-
"themeSources": [],
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
"name": ".",
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
|
|
57
|
-
exports[`readConfig wp config values should use default config values 1`] = `
|
|
58
|
-
{
|
|
59
|
-
"SCRIPT_DEBUG": false,
|
|
60
|
-
"WP_DEBUG": false,
|
|
61
|
-
"WP_ENVIRONMENT_TYPE": "local",
|
|
62
|
-
"WP_HOME": "http://localhost:8889/",
|
|
63
|
-
"WP_PHP_BINARY": "php",
|
|
64
|
-
"WP_SITEURL": "http://localhost:8889/",
|
|
65
|
-
"WP_TESTS_DOMAIN": "localhost",
|
|
66
|
-
"WP_TESTS_EMAIL": "admin@example.org",
|
|
67
|
-
"WP_TESTS_TITLE": "Test Blog",
|
|
68
|
-
}
|
|
69
|
-
`;
|
|
70
|
-
|
|
71
|
-
exports[`readConfig wp config values should use default config values 2`] = `
|
|
72
|
-
{
|
|
73
|
-
"SCRIPT_DEBUG": true,
|
|
74
|
-
"WP_DEBUG": true,
|
|
75
|
-
"WP_ENVIRONMENT_TYPE": "local",
|
|
76
|
-
"WP_HOME": "http://localhost:8888/",
|
|
77
|
-
"WP_PHP_BINARY": "php",
|
|
78
|
-
"WP_SITEURL": "http://localhost:8888/",
|
|
79
|
-
"WP_TESTS_DOMAIN": "localhost",
|
|
80
|
-
"WP_TESTS_EMAIL": "admin@example.org",
|
|
81
|
-
"WP_TESTS_TITLE": "Test Blog",
|
|
82
|
-
}
|
|
83
|
-
`;
|