Skip to content

Commit

Permalink
Merge pull request #45 from wp-cli/handle-old-syntax-gracefully
Browse files Browse the repository at this point in the history
Test graceful handling of old config syntax
  • Loading branch information
gitlost authored Jan 30, 2018
2 parents 0d02e56 + abfa3d5 commit 4e44b3f
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions features/config-backcompat.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Feature: Backwards compatibility

Scenario: wp config get --constant=<constant> --> wp config get <name> --type=constant
Given a WP install

When I run `wp config get --constant=DB_NAME`
Then STDOUT should be:
"""
wp_cli_test
"""

Scenario: wp config get --global=<global> --> wp config get <name> --type=variable
Given a WP install

When I run `wp config get --global=table_prefix`
Then STDOUT should be:
"""
wp_
"""

Scenario: wp config get --> wp config list
Given an empty directory
And WP files

When I run `wp core config {CORE_CONFIG_SETTINGS}`
Then STDOUT should contain:
"""
Generated 'wp-config.php' file.
"""

When I run `wp config get --fields=name,type`
Then STDOUT should be a table containing rows:
| name | type |
| DB_NAME | constant |
| DB_USER | constant |
| DB_PASSWORD | constant |
| DB_HOST | constant |

When I try `wp config get`
Then STDOUT should be a table containing rows:
| name | value | type |

0 comments on commit 4e44b3f

Please sign in to comment.