Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions features/config-add.feature
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Feature: Add a constant or variable to wp-config.php file
define( 'CONST_A', 'val-a' );
/** ANCHOR */
define( 'CONST_B', 'val-b' );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"""

When I run `wp config add SOME_NAME some_value --anchor="/** ANCHOR */" --placement=before --separator="\n"`
Expand All @@ -119,7 +119,7 @@ Feature: Add a constant or variable to wp-config.php file
define( 'SOME_NAME', 'some_value' );
/** ANCHOR */
define( 'CONST_B', 'val-b' );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""

When I run `wp config add ANOTHER_NAME another_value --anchor="/** ANCHOR */" --placement=after --separator="\n"`
Expand All @@ -134,5 +134,5 @@ Feature: Add a constant or variable to wp-config.php file
/** ANCHOR */
define( 'ANOTHER_NAME', 'another_value' );
define( 'CONST_B', 'val-b' );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""
22 changes: 11 additions & 11 deletions features/config-create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -248,24 +248,24 @@ Feature: Create a wp-config file
// The WP_CLI_TEST_DBSOCKET variable can be set in the environment to
// override the default locations and will take precedence.
if ( ! empty( getenv( 'WP_CLI_TEST_DBSOCKET' ) ) ) {
echo getenv( 'WP_CLI_TEST_DBSOCKET' );
exit(0);
echo getenv( 'WP_CLI_TEST_DBSOCKET' );
exit( 0 );
}
// From within Behat, the WP_CLI_TEST_DBSOCKET will be mapped to the internal
// DB_SOCKET variable, as Behat pushes a new environment context.
$locations = [
'{DB_SOCKET}',
'/var/run/mysqld/mysqld.sock',
'/tmp/mysql.sock',
'{DB_SOCKET}',
'/var/run/mysqld/mysqld.sock',
'/tmp/mysql.sock',
];
foreach ( $locations as $location ) {
if ( ! empty( $location ) && file_exists( $location ) ) {
echo $location;
exit(0);
}
if ( ! empty( $location ) && file_exists( $location ) ) {
echo $location;
exit( 0 );
}
}
echo 'No socket found';
exit(1);
exit( 1 );
"""

When I run `php find-socket.php`
Expand Down Expand Up @@ -371,7 +371,7 @@ Feature: Create a wp-config file
And a wp-config.php file:
"""
<?php
echo "some broken or custom wp-config.php file";
echo 'some broken or custom wp-config.php file';
"""

When I run `wp core download --path=subdir`
Expand Down
8 changes: 4 additions & 4 deletions features/config-get-field.feature
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Feature: Get the value of a constant or variable defined in wp-config.php and wp
"""
$SOMENAME = 'value-a';
define( 'SOMENAME', 'value-b' );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""

When I run `wp config list --format=table`
Expand Down Expand Up @@ -215,7 +215,7 @@ Feature: Get the value of a constant or variable defined in wp-config.php and wp
"""
$SOMENAME = 'value-a';
define( 'SOMENAME', 'value-b' );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""

When I run `wp config list --format=table --config-file='wp-custom-config.php'`
Expand Down Expand Up @@ -300,7 +300,7 @@ Feature: Get the value of a constant or variable defined in wp-config.php and wp
"""
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', false );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""

When I run `wp config get WP_DEBUG`
Expand All @@ -321,7 +321,7 @@ Feature: Get the value of a constant or variable defined in wp-config.php and wp
"""
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', false );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""

When I run `wp config get WP_DEBUG --format=json`
Expand Down
16 changes: 11 additions & 5 deletions features/config-has.feature
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,21 @@ Feature: Check whether the wp-config.php file or the wp-custom-config.php file h
$do_redirect = 'https://example.com' . $_SERVER['REQUEST_URI'];
$table_prefix = 'wp_';
define( 'DB_NAME', 'wp' );
define( 'CUSTOM_CSS', 'body {
define(
'CUSTOM_CSS',
'body {
color: red;
}' );
}'
);
$after_multiline = 'found';
$long_url = 'https://example.com'
. '/path';
define( 'ALLOWED_HOSTS', array(
'example.com',
) );
define(
'ALLOWED_HOSTS',
array(
'example.com',
)
);
$after_array_define = 'found';
"""

Expand Down
28 changes: 14 additions & 14 deletions features/config-list.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: List the values of a wp-config.php file
"""
And a custom-include.php file:
"""
<?php // This won't work without this file being empty. ?>
<?php // This won't work without this file being empty.
Comment thread
swissspidy marked this conversation as resolved.
"""

When I run `wp config create {CORE_CONFIG_SETTINGS} --skip-check --extra-php < wp-config-extra.php`
Expand Down Expand Up @@ -40,7 +40,7 @@ Feature: List the values of a wp-config.php file
"""
And a custom-include.php file:
"""
<?php // This won't work without this file being empty. ?>
<?php // This won't work without this file being empty.
"""

When I run `wp config create {CORE_CONFIG_SETTINGS} --skip-check --config-file='wp-custom-config.php' --extra-php < wp-config-extra.php`
Expand Down Expand Up @@ -339,14 +339,14 @@ Feature: List the values of a wp-config.php file
define( 'DB_CHARSET', 'utf8' );
define( 'DB_COLLATE', '' );

define('AUTH_KEY', '7mj0&+HVh{90t.S]m{u)$\'tCCB$:.[7}jAf`)~hS{ZL#v+&F#kA^p|*R<YaMFR,p');
define('SECURE_AUTH_KEY', 'c_0aQDj2.s}]rC+,JmU(VG!g4LapYREo+akySvE.M;lS4|Y(u%:f-|5wV_8$Niwm');
define('LOGGED_IN_KEY', '-wRn2hkn >J=FA3Si$i8uco>+6vB0&aej6X4r@2dc]V}|iFE!{CjOA*u#g4@Y.2j');
define('NONCE_KEY', 'O..4n~e~(~:7NGyA!q.(`:X,(RcR(n_o|&(*hKrX2+9D=,&1k2k-;>Y_@X+<CwRv');
define('AUTH_SALT', '8+hWU&.Zb ^Fix,Y*|XzaC-*&@?Nw%u(2-G_:6vz0RH(QE5*PP;!h6z{!t>,!6g!');
define('SECURE_AUTH_SALT', 'VNH|C>w-z?*dtP4ofy!v%RumM.}ug]mx7$QZW|C-R4T`d-~x|xvL{Xc_5C89K(,^');
define('LOGGED_IN_SALT', 'Iwtez|Q`M l7lup; x&ml8^C|Lk&X[3/-l!$`P3GM$7:WI&X$Hn)unjZ9u~g4m[c');
define('NONCE_SALT', 'QxcY|80 $f_dRkn*Liu|Ak*aas41g(q5X_h+m8Z$)tf6#TZ+Q,D#%n]g -{=mj1)');
define( 'AUTH_KEY', '7mj0&+HVh{90t.S]m{u)$\'tCCB$:.[7}jAf`)~hS{ZL#v+&F#kA^p|*R<YaMFR,p' );
define( 'SECURE_AUTH_KEY', 'c_0aQDj2.s}]rC+,JmU(VG!g4LapYREo+akySvE.M;lS4|Y(u%:f-|5wV_8$Niwm' );
define( 'LOGGED_IN_KEY', '-wRn2hkn >J=FA3Si$i8uco>+6vB0&aej6X4r@2dc]V}|iFE!{CjOA*u#g4@Y.2j' );
define( 'NONCE_KEY', 'O..4n~e~(~:7NGyA!q.(`:X,(RcR(n_o|&(*hKrX2+9D=,&1k2k-;>Y_@X+<CwRv' );
define( 'AUTH_SALT', '8+hWU&.Zb ^Fix,Y*|XzaC-*&@?Nw%u(2-G_:6vz0RH(QE5*PP;!h6z{!t>,!6g!' );
define( 'SECURE_AUTH_SALT', 'VNH|C>w-z?*dtP4ofy!v%RumM.}ug]mx7$QZW|C-R4T`d-~x|xvL{Xc_5C89K(,^' );
define( 'LOGGED_IN_SALT', 'Iwtez|Q`M l7lup; x&ml8^C|Lk&X[3/-l!$`P3GM$7:WI&X$Hn)unjZ9u~g4m[c' );
define( 'NONCE_SALT', 'QxcY|80 $f_dRkn*Liu|Ak*aas41g(q5X_h+m8Z$)tf6#TZ+Q,D#%n]g -{=mj1)' );

$table_prefix = 'wp_';

Expand All @@ -362,7 +362,7 @@ Feature: List the values of a wp-config.php file
/* That's all, stop editing! Happy publishing. */

if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', dirname( __FILE__ ) . '/' );
define( 'ABSPATH', __DIR__ . '/' );
}

require_once ABSPATH . 'wp-settings.php';
Expand Down Expand Up @@ -428,7 +428,7 @@ Feature: List the values of a wp-config.php file
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""

When I run `wp config list --fields=name,value,type --format=table`
Expand All @@ -444,7 +444,7 @@ Feature: List the values of a wp-config.php file
"""
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""

When I run `wp config list WP_DEBUG --strict --format=json`
Expand All @@ -465,7 +465,7 @@ Feature: List the values of a wp-config.php file
"""
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""

When I run `wp config list WP_DEBUG --strict --format=dotenv`
Expand Down
12 changes: 6 additions & 6 deletions features/config-set.feature
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ Feature: Set the value of a constant or variable defined in wp-config.php file a
define( 'CONST_A', 'val-a' );
/** ANCHOR */
define( 'CONST_B', 'val-b' );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""

When I run `wp config set SOME_NAME some_value --type=constant --anchor="/** ANCHOR */" --placement=before --separator="\n"`
Expand All @@ -365,7 +365,7 @@ Feature: Set the value of a constant or variable defined in wp-config.php file a
define( 'SOME_NAME', 'some_value' );
/** ANCHOR */
define( 'CONST_B', 'val-b' );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""

When I run `wp config set ANOTHER_NAME another_value --type=constant --anchor="/** ANCHOR */" --placement=after --separator="\n"`
Expand All @@ -380,7 +380,7 @@ Feature: Set the value of a constant or variable defined in wp-config.php file a
/** ANCHOR */
define( 'ANOTHER_NAME', 'another_value' );
define( 'CONST_B', 'val-b' );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""

Scenario: Additions can be properly placed in wp-custom-config.php
Expand All @@ -390,7 +390,7 @@ Feature: Set the value of a constant or variable defined in wp-config.php file a
define( 'CONST_A', 'val-a' );
/** ANCHOR */
define( 'CONST_B', 'val-b' );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""

When I run `wp config set SOME_NAME some_value --type=constant --anchor="/** ANCHOR */" --placement=before --separator="\n" --config-file="wp-custom-config.php"`
Expand All @@ -404,7 +404,7 @@ Feature: Set the value of a constant or variable defined in wp-config.php file a
define( 'SOME_NAME', 'some_value' );
/** ANCHOR */
define( 'CONST_B', 'val-b' );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""

When I run `wp config set ANOTHER_NAME another_value --type=constant --anchor="/** ANCHOR */" --placement=after --separator="\n" --config-file="wp-custom-config.php"`
Expand All @@ -419,5 +419,5 @@ Feature: Set the value of a constant or variable defined in wp-config.php file a
/** ANCHOR */
define( 'ANOTHER_NAME', 'another_value' );
define( 'CONST_B', 'val-b' );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""
6 changes: 3 additions & 3 deletions features/config-update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Feature: Update or add a constant or variable in wp-config.php file
define( 'CONST_A', 'val-a' );
/** ANCHOR */
define( 'CONST_B', 'val-b' );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"""

When I run `wp config update SOME_NAME some_value --anchor="/** ANCHOR */" --placement=before --separator="\n"`
Expand All @@ -170,7 +170,7 @@ Feature: Update or add a constant or variable in wp-config.php file
define( 'SOME_NAME', 'some_value' );
/** ANCHOR */
define( 'CONST_B', 'val-b' );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""

When I run `wp config update SOME_NAME updated_value --anchor="/** ANCHOR */" --placement=before --separator="\n"`
Expand All @@ -184,5 +184,5 @@ Feature: Update or add a constant or variable in wp-config.php file
define( 'SOME_NAME', 'updated_value' );
/** ANCHOR */
define( 'CONST_B', 'val-b' );
require_once( ABSPATH . 'wp-settings.php' );
require_once ABSPATH . 'wp-settings.php';
"""