Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
List files included by wp-config.php
- Loading branch information
Showing
2 changed files
with
54 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,40 @@ | ||
Feature: Manage wp-config.php file | ||
|
||
Background: | ||
Given a WP install | ||
Scenario: List constants, globals and files included from wp-config.php | ||
Given an empty directory | ||
And WP files | ||
And a wp-config-extra.php file: | ||
""" | ||
require_once 'custom-include.php'; | ||
""" | ||
And a custom-include.php file: | ||
""" | ||
<?php // This won't work without this file being empty. ?> | ||
""" | ||
When I run `wp core config {CORE_CONFIG_SETTINGS} --extra-php < wp-config-extra.php` | ||
Then STDOUT should contain: | ||
""" | ||
Generated 'wp-config.php' file. | ||
""" | ||
When I run `wp config get --fields=key,type` | ||
Then STDOUT should be a table containing rows: | ||
| key | type | | ||
| DB_NAME | constant | | ||
| DB_USER | constant | | ||
| DB_PASSWORD | constant | | ||
| DB_HOST | constant | | ||
| custom-include.php | includes | | ||
When I try `wp config get` | ||
Then STDOUT should be a table containing rows: | ||
| key | value | type | | ||
Scenario: Get a wp-config.php file path | ||
Given a WP install | ||
When I try `wp config path` | ||
And STDOUT should contain: | ||
""" | ||
wp-config.php | ||
""" | ||
And STDERR should be empty | ||
|
||
Scenario: Get configurations defined in a wp-config.php file | ||
When I try `wp config get` | ||
Then STDOUT should be a table containing rows: | ||
| key | value | type | | ||
|
||
When I try `wp config get --fields=key,type` | ||
Then STDOUT should be a table containing rows: | ||
| key | type | | ||
| DB_NAME | constant | | ||
| DB_USER | constant | | ||
| DB_PASSWORD | constant | | ||
| DB_HOST | constant | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters