Skip to content

Proper coding style for wp-config#3496

Merged
danielbachhuber merged 3 commits into
wp-cli:masterfrom
szepeviktor:patch-1
Oct 26, 2016
Merged

Proper coding style for wp-config#3496
danielbachhuber merged 3 commits into
wp-cli:masterfrom
szepeviktor:patch-1

Conversation

@szepeviktor
Copy link
Copy Markdown
Contributor

We don't have to copy ugliness.

We don't have to copy ugliness.
@danielbachhuber
Copy link
Copy Markdown
Member

@szepeviktor Can you update the appropriate tests please?

@danielbachhuber
Copy link
Copy Markdown
Member

@szepeviktor Looks like the build is still failing.

@szepeviktor
Copy link
Copy Markdown
Contributor Author

OK. Running home-travis :)

@szepeviktor
Copy link
Copy Markdown
Contributor Author

@szepeviktor
Copy link
Copy Markdown
Contributor Author

szepeviktor commented Oct 26, 2016

It has something to do with WP version < 4.0

if ( \WP_CLI\Utils\wp_version_compare( '4.0', '<' ) ) {
$assoc_args['add-wplang'] = true;
} else {
$assoc_args['add-wplang'] = false;
}

@szepeviktor
Copy link
Copy Markdown
Contributor Author

szepeviktor commented Oct 26, 2016

Summary

Up to this PR the WPLANG test ran on WP < 4.0 also. That is not good. But it did not fail because of spaces.

I suggest to remove And the wp-config.php file should not contain: and add a new scenario:

@require-wp-4.0
Scenario: No wp-config.php and WPLANG
  Given a wp-config-extra.php file:
    """
    define( 'WP_DEBUG_LOG', true );
    """
  When I run `wp core config {CORE_CONFIG_SETTINGS} --extra-php < wp-config-extra.php`
  Then the wp-config.php file should not contain:
    """
    define( 'WPLANG', '' );
    """

@danielbachhuber danielbachhuber merged commit 5672b63 into wp-cli:master Oct 26, 2016
@szepeviktor szepeviktor deleted the patch-1 branch October 26, 2016 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants