Add term recount command#2625
Conversation
|
Can you make sure to include functional tests? http://wp-cli.org/docs/pull-requests/#functional-tests |
|
Will do! |
|
Thanks :) and you can create a new |
| """ | ||
| Success: Updated category term count | ||
| Success: Updated post_tag term count | ||
| """ |
There was a problem hiding this comment.
What do you think about adding a test for ensuring wp_update_term_count() works as expected? As in, setting the count field in the database to an incorrect value, and then triggering recount to ensure it gets updated to the expected value?
There was a problem hiding this comment.
Talking about running a manual SQL update to the wp_term_taxonomy table, then running the recount function and verifying the change afterward? Sure, that makes sense.
There was a problem hiding this comment.
Talking about running a manual SQL update to the wp_term_taxonomy table, then running the recount function and verifying the change afterward?
Yep
There was a problem hiding this comment.
Cool, I took a look at the comment-recount.feature and that'll get me started in the right direction for the test.
…t via the WP-CLI command
| When I run `wp term recount category` | ||
| And I run `wp term get category {TERM_ID} --field=count` | ||
| """ | ||
| 1 |
|
Thanks again for your work on this, @petenelson ! |
|
You're welcome, and thank you for inspiring me to start adding unit tests and CI to my own projects! |
Fixes #2621