Changeset 31793 for trunk/tests/phpunit/tests/comment/query.php
- Timestamp:
- 03/16/2015 02:23:33 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/comment/query.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/query.php
r31666 r31793 1588 1588 $this->assertEqualSets( array_merge( $c1, $c3 ), $found ); 1589 1589 } 1590 1591 /** 1592 * @ticket 24826 1593 */ 1594 public function test_comment_query_object() { 1595 $comment_id = $this->factory->comment->create(); 1596 1597 $query1 = new WP_Comment_Query(); 1598 $this->assertNull( $query1->query_vars ); 1599 $this->assertEmpty( $query1->comments ); 1600 $comments = $query1->query( array( 'status' => 'all' ) ); 1601 $this->assertInternalType( 'array', $query1->query_vars ); 1602 $this->assertNotEmpty( $query1->comments ); 1603 $this->assertInternalType( 'array', $query1->comments ); 1604 1605 $query2 = new WP_Comment_Query( array( 'status' => 'all' ) ); 1606 $this->assertNotEmpty( $query2->query_vars ); 1607 $this->assertNotEmpty( $query2->comments ); 1608 $this->assertEquals( $query2->comments, $query1->get_comments() ); 1609 } 1610 1611 /** 1612 * @ticket 22400 1613 */ 1614 public function test_comment_cache_key_should_ignore_custom_params() { 1615 global $wpdb; 1616 1617 $p = $this->factory->post->create(); 1618 $c = $this->factory->comment->create( array( 'comment_post_ID' => $p ) ); 1619 1620 $q1 = new WP_Comment_Query(); 1621 $q1->query( array( 1622 'post_id' => $p, 1623 ) ); 1624 1625 $num_queries = $wpdb->num_queries; 1626 1627 $q2 = new WP_Comment_Query(); 1628 $q2->query( array( 1629 'post_id' => $p, 1630 'foo' => 'bar', 1631 ) ); 1632 1633 $this->assertSame( $num_queries, $wpdb->num_queries ); 1634 } 1590 1635 }
Note: See TracChangeset
for help on using the changeset viewer.