-
Notifications
You must be signed in to change notification settings - Fork 24
Add --format flag to language update commands
#170
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 all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
3bd980a
Initial plan
Copilot a44033d
Add --format flag support to language update commands
Copilot 4594dcb
Add tests for --format flag in update commands
Copilot 3f88849
Fix format output for empty update results
Copilot 2ec032e
Refactor update method to avoid code duplication and fix slug key logic
Copilot 75f704d
Optimize data collection to skip summary format
Copilot 7978aad
Use WP_CLI::log instead of WP_CLI::line for proper quiet logger support
Copilot c62f573
Improve maintainability by using slug_key variable consistently
Copilot e0157bf
Fix format output to suppress success message and use standard test f…
Copilot 73abc92
Show success message only for summary format and add tests with actua…
Copilot fd5a464
Fix test expectations and remove invalid --force flag from language i…
Copilot 374d75e
Fix format handling to show success messages for table format
Copilot 1e612fb
Uninstall language before reinstalling to ensure updates are triggered
Copilot ef8e06f
Fix dry-run output to show message for table/summary formats and fix …
Copilot 683e5b9
Lint fixes
swissspidy b4870d3
Merge branch 'main' into copilot/add-format-flag-to-update-commands
swissspidy 5fd48aa
Merge branch 'main' into copilot/add-format-flag-to-update-commands
swissspidy bf304ba
Add dry-run with format flag tests and fix documentation
Copilot e12d2e8
Merge branch 'main' into copilot/add-format-flag-to-update-commands
swissspidy 715eb3e
Fix synopsis
swissspidy 554eaa3
Fix dry-run with summary format to produce no output
Copilot 6fc665e
Fix tests
swissspidy 30827fd
Fix phpdoc
swissspidy d92e45c
Fix test
swissspidy f293521
Merge branch 'main' into copilot/add-format-flag-to-update-commands
swissspidy b73d242
Test fix
swissspidy b587c71
Merge branch 'main' into copilot/add-format-flag-to-update-commands
swissspidy 5d6c983
Fix test
swissspidy c904b44
Fix merge issue
swissspidy 330adba
Merge branch 'main' into copilot/add-format-flag-to-update-commands
swissspidy cfb31d3
Add space
swissspidy d5e931b
Fix test
swissspidy 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
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -477,6 +477,77 @@ Feature: Manage core translation files for a WordPress install | |
| | nl_NL | installed | | ||
| And STDERR should be empty | ||
|
|
||
| @require-wp-4.0 | ||
| Scenario: Core translation update with format flag | ||
| Given a WP install | ||
| And an empty cache | ||
|
|
||
| When I run `wp language core update --format=json` | ||
| Then STDOUT should be: | ||
| """ | ||
| [] | ||
| """ | ||
| And STDERR should be empty | ||
|
|
||
| When I run `wp language core update --format=csv` | ||
| Then STDOUT should be empty | ||
| And STDERR should be empty | ||
|
|
||
| When I run `wp language core update --format=summary` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Success: Translations are up to date. | ||
| """ | ||
| And STDERR should be empty | ||
|
|
||
| @require-wp-6.0 @require-php-7.2 | ||
| Scenario Outline: Core translation update with dry-run and format flag | ||
| Given an empty directory | ||
| And WP files | ||
| And a database | ||
| And I run `wp core download --version=<original> --force` | ||
| And wp-config.php | ||
| And I run `wp core install --url='localhost:8001' --title='Test' --admin_user=wpcli [email protected] --admin_password=1` | ||
|
|
||
| When I run `wp language core install en_CA ja` | ||
| Then STDERR should be empty | ||
|
|
||
| Given I try `wp core download --version=<update> --force` | ||
| Then the return code should be 0 | ||
| And I run `wp core update-db` | ||
|
|
||
| When I run `wp language core list --fields=language,status,update` | ||
| Then STDOUT should be a table containing rows: | ||
| | language | status | update | | ||
| | en_CA | installed | available | | ||
| | ja | installed | available | | ||
|
|
||
| When I run `wp language core update --dry-run --format=json` | ||
| Then STDOUT should be JSON containing: | ||
| """ | ||
| [{"Type":"Core","Name":"WordPress","Version":"<update>"}] | ||
| """ | ||
| And STDERR should be empty | ||
|
|
||
| When I run `wp language core update --dry-run --format=csv` | ||
| Then STDOUT should contain: | ||
| """ | ||
| Type,Name,Version,Language | ||
| """ | ||
| And STDOUT should contain: | ||
| """ | ||
| Core,WordPress,<update> | ||
| """ | ||
| And STDERR should be empty | ||
|
|
||
| When I run `wp language core update --dry-run --format=summary` | ||
| Then STDOUT should be empty | ||
| And STDERR should be empty | ||
|
|
||
| Examples: | ||
| | original | update | | ||
| | 6.5 | 6.6 | | ||
|
|
||
| @require-wp-4.0 | ||
| Scenario: Install languages with different output formats | ||
| Given a WP install | ||
|
|
||
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
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.