Changeset 34599 for trunk/tests/phpunit/tests/comment/query.php
- Timestamp:
- 09/26/2015 04:01:05 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/query.php
r34569 r34599 2109 2109 $this->assertEqualSets( array(), array_values( wp_list_pluck( $q->comments[ $c1 ]->get_child( $c2 )->get_children( $args ), 'comment_ID' ) ) ); 2110 2110 } 2111 2112 /** 2113 * @ticket 27571 2114 */ 2115 public function test_update_comment_post_cache_should_be_disabled_by_default() { 2116 global $wpdb; 2117 2118 $p = $this->factory->post->create(); 2119 $c = $this->factory->comment->create( array( 'comment_post_ID' => $p ) ); 2120 2121 $q = new WP_Comment_Query( array( 2122 'post_ID' => $p, 2123 ) ); 2124 2125 $num_queries = $wpdb->num_queries; 2126 $this->assertTrue( isset( $q->comments[0]->post_name ) ); 2127 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); 2128 } 2129 2130 /** 2131 * @ticket 27571 2132 */ 2133 public function test_should_respect_update_comment_post_cache_true() { 2134 global $wpdb; 2135 2136 $p = $this->factory->post->create(); 2137 $c = $this->factory->comment->create( array( 'comment_post_ID' => $p ) ); 2138 2139 $q = new WP_Comment_Query( array( 2140 'post_ID' => $p, 2141 'update_comment_post_cache' => true, 2142 ) ); 2143 2144 $num_queries = $wpdb->num_queries; 2145 $this->assertTrue( isset( $q->comments[0]->post_name ) ); 2146 $this->assertSame( $num_queries, $wpdb->num_queries ); 2147 } 2111 2148 }
Note: See TracChangeset
for help on using the changeset viewer.