Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion features/comment-recount.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ Feature: Recount comments on a post
3
"""

When I run `wp eval 'global $wpdb; $wpdb->update( $wpdb->posts, array( "comment_count" => 1 ), array( "ID" => 1 ) ); clean_post_cache( 1 );'`
Given a recount-comments.php file:
"""
<?php
global $wpdb;
$wpdb->update( $wpdb->posts, array( "comment_count" => 1 ), array( "ID" => 1 ) );
clean_post_cache( 1 );
"""
When I run `wp eval-file recount-comments.php`
And I run `wp post get 1 --field=comment_count`
Then STDOUT should be:
"""
Expand Down
Loading
Loading