-
Notifications
You must be signed in to change notification settings - Fork 94
Add commands for managing signups on multisite #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f852acf
Add signup command class
ernilambar 660fff5
Update command docs
ernilambar 986adb9
Update success and error messages
ernilambar 5aee1c4
Update readme based on new success messages
ernilambar e3bfbbc
Update delete method to user callback function
ernilambar 75b5b55
Accept multiple signups in activate command
ernilambar d5592a6
Update arguments description
ernilambar a02a3e6
Move signup under user command
ernilambar 32b75d4
Remove Signup fetcher class
ernilambar ef4f8dc
Update wp-cli version
ernilambar 778ca3e
Revert cli version
ernilambar adde1d7
Use fetcher from main library
ernilambar b266645
Use batch results helper for signup activate
ernilambar 0d2e74a
Implement --all in signup delete command
ernilambar d0d5a84
Use log method instead of success
ernilambar 5fd3657
Fix indenting issue in feature test file
ernilambar 889336b
Introduce --per_page argument in signup list command
ernilambar File filter
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
Add signup command class
- Loading branch information
commit f852acf60691e5dcb6d6dcf5d35bb13754b586bb
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| Feature: Manage signups in a multisite installation | ||
ernilambar marked this conversation as resolved.
Show resolved
Hide resolved
ernilambar marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Scenario: Not applicable in single installation site | ||
| Given a WP install | ||
|
|
||
| When I try `wp signup list` | ||
| Then STDERR should be: | ||
| """ | ||
| Error: This is not a multisite installation. | ||
| """ | ||
|
|
||
| Scenario: List signups | ||
| Given a WP multisite install | ||
| And I run `wp eval 'wpmu_signup_user( "bobuser", "bobuser@example.com" );'` | ||
| And I run `wp eval 'wpmu_signup_user( "johnuser", "johnuser@example.com" );'` | ||
|
|
||
| When I run `wp signup list --fields=signup_id,user_login,user_email,active --format=csv` | ||
| Then STDOUT should be: | ||
| """ | ||
| signup_id,user_login,user_email,active | ||
| 1,bobuser,bobuser@example.com,0 | ||
| 2,johnuser,johnuser@example.com,0 | ||
| """ | ||
|
|
||
| When I run `wp signup list --format=count --active=1` | ||
| Then STDOUT should be: | ||
| """ | ||
| 0 | ||
| """ | ||
|
|
||
| When I run `wp signup activate bobuser` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Success: Signup activated. | ||
| """ | ||
|
|
||
| When I run `wp signup list --fields=signup_id,user_login,user_email,active --format=csv --active=1` | ||
| Then STDOUT should be: | ||
| """ | ||
| signup_id,user_login,user_email,active | ||
| 1,bobuser,bobuser@example.com,1 | ||
| """ | ||
|
|
||
| Scenario: Get signup | ||
| Given a WP multisite install | ||
| And I run `wp eval 'wpmu_signup_user( "bobuser", "bobuser@example.com" );'` | ||
|
|
||
| When I run `wp signup get bobuser --fields=signup_id,user_login,user_email,active --format=csv` | ||
| Then STDOUT should be: | ||
| """ | ||
| signup_id,user_login,user_email,active | ||
| 1,bobuser,bobuser@example.com,0 | ||
| """ | ||
|
|
||
| Scenario: Delete signup | ||
| Given a WP multisite install | ||
|
|
||
| When I run `wp eval 'wpmu_signup_user( "bobuser", "bobuser@example.com" );'` | ||
| And I run `wp signup get bobuser --field=user_login` | ||
| Then STDOUT should be: | ||
| """ | ||
| bobuser | ||
| """ | ||
|
|
||
| When I run `wp signup delete bobuser@example.com` | ||
| Then STDOUT should be: | ||
| """ | ||
| Success: Signup deleted. | ||
| """ | ||
|
|
||
| When I try `wp signup get bobuser` | ||
| Then STDERR should be: | ||
| """ | ||
| Error: Invalid signup ID, email, login or activation key: 'bobuser' | ||
ernilambar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| """ | ||
|
|
||
| Scenario: Activate signup | ||
| Given a WP multisite install | ||
| And I run `wp eval 'wpmu_signup_user( "bobuser", "bobuser@example.com" );'` | ||
|
|
||
| And I run `wp signup get bobuser --field=active` | ||
| Then STDOUT should be: | ||
| """ | ||
| 0 | ||
| """ | ||
|
|
||
| When I run `wp signup activate bobuser` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Success: Signup activated. | ||
| """ | ||
|
|
||
| When I run `wp signup get bobuser --field=active` | ||
| Then STDOUT should be: | ||
| """ | ||
| 1 | ||
| """ | ||
|
|
||
| When I run `wp user get bobuser --field=user_email` | ||
| Then STDOUT should be: | ||
| """ | ||
| bobuser@example.com | ||
| """ | ||
|
|
||
| Scenario: Activate blog signup entry | ||
| Given a WP multisite install | ||
| And I run `wp eval 'wpmu_signup_blog( "example.com", "/bobsite/", "My Awesome Title", "bobuser", "bobuser@example.com" );'` | ||
|
|
||
| When I run `wp signup get bobuser --fields=user_login,domain,path,active --format=csv` | ||
| Then STDOUT should be: | ||
| """ | ||
| user_login,domain,path,active | ||
| bobuser,example.com,/bobsite/,0 | ||
| """ | ||
|
|
||
| When I run `wp signup activate bobuser` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Success: Signup activated. | ||
| """ | ||
|
|
||
| When I run `wp site list --fields=domain,path` | ||
| Then STDOUT should be a table containing rows: | ||
| | domain | path | | ||
| | example.com | / | | ||
| | example.com | /bobsite/ | | ||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.