Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Don't require wp-config to be read-only for wp config has
  • Loading branch information
pwtyler committed Sep 17, 2024
commit 5ee2679283f6df48c5b659a8648a51b626e8a031
8 changes: 8 additions & 0 deletions features/config-has.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ Feature: Check whether the wp-config.php file or the wp-custom-config.php file h
Then STDOUT should be empty
And the return code should be 0

Scenario: Check for the existance of an existing wp-config.php constant in a read-only file system
Given a WP install

When I run `chmod -w wp-config.php`
And I try `wp config has DB_NAME`
Then STDOUT should be empty
And the return code should be 0

@custom-config-file
Scenario: Check the existence of an existing wp-custom-config.php constant or variable
Given an empty directory
Expand Down
2 changes: 1 addition & 1 deletion src/Config_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ public function has( $args, $assoc_args ) {
$type = Utils\get_flag_value( $assoc_args, 'type' );

try {
$config_transformer = new WPConfigTransformer( $path );
$config_transformer = new WPConfigTransformer( $path, true );

switch ( $type ) {
case 'all':
Expand Down