Skip to content

A class @when shouldn't overrides individual method @whens. #4458

Merged
danielbachhuber merged 10 commits intomasterfrom
patch-4350
Oct 24, 2017
Merged

A class @when shouldn't overrides individual method @whens. #4458
danielbachhuber merged 10 commits intomasterfrom
patch-4350

Conversation

@miya0001
Copy link
Member

@miya0001 miya0001 commented Oct 20, 2017

Fixes #4350

@miya0001
Copy link
Member Author

I removed @when after_wp_load form wp cli has_command, because it is executed at before_wp_loaded and this command doesn't need WP.
Also, this command is tested with empty directory.

@miya0001
Copy link
Member Author

I changed my mind. 😊
I reverted after_wp_load for wp cli has_command and updated the scenario for this.

@miya0001 miya0001 requested a review from a team October 22, 2017 11:46
* @when after_wp_load
*/
public function home_url() {
WP_CLI::success( home_url() );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make these tests more precise, could we have each method var_dump( function_exists( 'home_url' ) )?

With this approach, we'll know definitely whether WordPress has loaded or not.

@miya0001
Copy link
Member Author

@danielbachhuber

var_dump( function_exists( 'home_url' ) );

It is nice idea. I did it.

Copy link
Member

@danielbachhuber danielbachhuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

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