Changeset 48937 for trunk/tests/phpunit/tests/comment/query.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/query.php
r47122 r48937 723 723 ); 724 724 725 $this->assert Equals( array( $c2 ), $found );725 $this->assertSame( array( $c2 ), $found ); 726 726 } 727 727 … … 759 759 ); 760 760 761 $this->assert Equals( array( $c2 ), $found );761 $this->assertSame( array( $c2 ), $found ); 762 762 } 763 763 … … 875 875 ); 876 876 877 $this->assert Equals( array( $c2 ), $found );877 $this->assertSame( array( $c2 ), $found ); 878 878 } 879 879 … … 911 911 ); 912 912 913 $this->assert Equals( array( $c2 ), $found );913 $this->assertSame( array( $c2 ), $found ); 914 914 } 915 915 … … 1017 1017 ); 1018 1018 1019 $this->assert Equals( array( $c2 ), $found );1019 $this->assertSame( array( $c2 ), $found ); 1020 1020 } 1021 1021 … … 1045 1045 ); 1046 1046 1047 $this->assert Equals( array( $c1 ), $found );1047 $this->assertSame( array( $c1 ), $found ); 1048 1048 } 1049 1049 … … 1076 1076 ); 1077 1077 1078 $this->assert Equals( array( $c2 ), $found );1078 $this->assertSame( array( $c2 ), $found ); 1079 1079 } 1080 1080 … … 1294 1294 $post_id = self::factory()->post->create(); 1295 1295 self::factory()->comment->create_post_comments( $post_id, $limit ); 1296 1296 1297 $comments = get_comments( array( 'post_id' => $post_id ) ); 1297 $this->assert Equals( $limit, count( $comments ) );1298 $this->assertSame( $limit, count( $comments ) ); 1298 1299 foreach ( $comments as $comment ) { 1299 1300 $this->assertEquals( $post_id, $comment->comment_post_ID ); … … 1302 1303 $post_id2 = self::factory()->post->create(); 1303 1304 self::factory()->comment->create_post_comments( $post_id2, $limit ); 1305 1304 1306 $comments = get_comments( array( 'post_id' => $post_id2 ) ); 1305 $this->assert Equals( $limit, count( $comments ) );1307 $this->assertSame( $limit, count( $comments ) ); 1306 1308 foreach ( $comments as $comment ) { 1307 1309 $this->assertEquals( $post_id2, $comment->comment_post_ID ); … … 1310 1312 $post_id3 = self::factory()->post->create(); 1311 1313 self::factory()->comment->create_post_comments( $post_id3, $limit, array( 'comment_approved' => '0' ) ); 1314 1312 1315 $comments = get_comments( array( 'post_id' => $post_id3 ) ); 1313 $this->assert Equals( $limit, count( $comments ) );1316 $this->assertSame( $limit, count( $comments ) ); 1314 1317 foreach ( $comments as $comment ) { 1315 1318 $this->assertEquals( $post_id3, $comment->comment_post_ID ); … … 1322 1325 ) 1323 1326 ); 1324 $this->assert Equals( $limit, count( $comments ) );1327 $this->assertSame( $limit, count( $comments ) ); 1325 1328 foreach ( $comments as $comment ) { 1326 1329 $this->assertEquals( $post_id3, $comment->comment_post_ID ); … … 1333 1336 ) 1334 1337 ); 1335 $this->assert Equals( 0, count( $comments ) );1338 $this->assertSame( 0, count( $comments ) ); 1336 1339 1337 1340 self::factory()->comment->create_post_comments( $post_id3, $limit, array( 'comment_approved' => '1' ) ); 1338 1341 $comments = get_comments( array( 'post_id' => $post_id3 ) ); 1339 $this->assert Equals( $limit * 2, count( $comments ) );1342 $this->assertSame( $limit * 2, count( $comments ) ); 1340 1343 foreach ( $comments as $comment ) { 1341 1344 $this->assertEquals( $post_id3, $comment->comment_post_ID ); … … 1364 1367 ) 1365 1368 ); 1366 $this->assert Equals( 2, count( $comments ) );1369 $this->assertSame( 2, count( $comments ) ); 1367 1370 $this->assertEquals( $comment_id2, $comments[0]->comment_ID ); 1368 1371 $this->assertEquals( $comment_id, $comments[1]->comment_ID ); … … 1374 1377 ) 1375 1378 ); 1376 $this->assert Equals( 2, count( $comments ) );1379 $this->assertSame( 2, count( $comments ) ); 1377 1380 $this->assertEquals( $comment_id2, $comments[0]->comment_ID ); 1378 1381 $this->assertEquals( $comment_id, $comments[1]->comment_ID ); … … 1385 1388 ) 1386 1389 ); 1387 $this->assert Equals( 2, count( $comments ) );1390 $this->assertSame( 2, count( $comments ) ); 1388 1391 $this->assertEquals( $comment_id, $comments[0]->comment_ID ); 1389 1392 $this->assertEquals( $comment_id2, $comments[1]->comment_ID ); … … 1396 1399 ) 1397 1400 ); 1398 $this->assert Equals( 2, count( $comments ) );1401 $this->assertSame( 2, count( $comments ) ); 1399 1402 $this->assertEquals( $comment_id, $comments[0]->comment_ID ); 1400 1403 $this->assertEquals( $comment_id2, $comments[1]->comment_ID ); … … 1424 1427 ) 1425 1428 ); 1426 $this->assert Equals( 1, count( $comments ) );1429 $this->assertSame( 1, count( $comments ) ); 1427 1430 1428 1431 $comments = get_comments( … … 1432 1435 ) 1433 1436 ); 1434 $this->assert Equals( 1, count( $comments ) );1437 $this->assertSame( 1, count( $comments ) ); 1435 1438 } 1436 1439 … … 1459 1462 ); 1460 1463 1461 $this->assert Equals( array( $comments[1], $comments[2], $comments[0] ), $found );1464 $this->assertSame( array( $comments[1], $comments[2], $comments[0] ), $found ); 1462 1465 } 1463 1466 … … 1503 1506 ); 1504 1507 1505 $this->assert Equals( array( $c3, $c1, $c2 ), $found );1508 $this->assertSame( array( $c3, $c1, $c2 ), $found ); 1506 1509 } 1507 1510 … … 1540 1543 ); 1541 1544 1542 $this->assert Equals( array( $comments[2], $comments[0], $comments[1] ), $found );1545 $this->assertSame( array( $comments[2], $comments[0], $comments[1] ), $found ); 1543 1546 } 1544 1547 … … 1566 1569 ); 1567 1570 1568 $this->assert Equals( array( $comments[2] ), $q->get_comments() );1571 $this->assertSame( array( $comments[2] ), $q->get_comments() ); 1569 1572 } 1570 1573 … … 1592 1595 ); 1593 1596 1594 $this->assert Equals( array( $comments[0] ), $q->get_comments() );1597 $this->assertSame( array( $comments[0] ), $q->get_comments() ); 1595 1598 } 1596 1599 … … 2897 2900 ); 2898 2901 2899 $this->assert Equals( 2, $found );2902 $this->assertSame( 2, $found ); 2900 2903 } 2901 2904 … … 2938 2941 ); 2939 2942 2940 $this->assert Equals( 2, $found );2943 $this->assertSame( 2, $found ); 2941 2944 } 2942 2945 … … 3673 3676 ); 3674 3677 3675 $this->assert Equals( array( $c2, $c3 ), $ids->comments );3678 $this->assertSame( array( $c2, $c3 ), $ids->comments ); 3676 3679 3677 3680 } … … 3690 3693 ); 3691 3694 3692 $this->assert Equals( 0, $q->found_comments );3693 $this->assert Equals( 0, $q->max_num_pages );3695 $this->assertSame( 0, $q->found_comments ); 3696 $this->assertSame( 0, $q->max_num_pages ); 3694 3697 } 3695 3698 … … 3708 3711 ); 3709 3712 3710 $this->assert Equals( 0, $q->found_comments );3711 $this->assert Equals( 0, $q->max_num_pages );3713 $this->assertSame( 0, $q->found_comments ); 3714 $this->assertSame( 0, $q->max_num_pages ); 3712 3715 } 3713 3716 … … 3726 3729 ); 3727 3730 3728 $this->assert Equals( 3, $q->found_comments );3731 $this->assertSame( 3, $q->found_comments ); 3729 3732 $this->assertEquals( 2, $q->max_num_pages ); 3730 3733 } … … 3796 3799 ); 3797 3800 3798 $this->assert Equals( array( $top_level_comments[0], $top_level_comments[1] ), $q->comments );3801 $this->assertSame( array( $top_level_comments[0], $top_level_comments[1] ), $q->comments ); 3799 3802 } 3800 3803 … … 4677 4680 ) 4678 4681 ); 4679 $this->assert Equals( $number_of_queries + 1, $wpdb->num_queries );4682 $this->assertSame( $number_of_queries + 1, $wpdb->num_queries ); 4680 4683 } 4681 4684 … … 4706 4709 ) 4707 4710 ); 4708 $this->assert Equals( $number_of_queries, $wpdb->num_queries );4711 $this->assertSame( $number_of_queries, $wpdb->num_queries ); 4709 4712 } 4710 4713 … … 4734 4737 ); 4735 4738 4736 $this->assert Equals( $number_of_queries, $wpdb->num_queries );4739 $this->assertSame( $number_of_queries, $wpdb->num_queries ); 4737 4740 } 4738 4741 … … 4906 4909 4907 4910 // Make sure manually setting total_users doesn't get overwritten. 4908 $this->assert Equals( 1, $q->found_comments );4911 $this->assertSame( 1, $q->found_comments ); 4909 4912 } 4910 4913
Note: See TracChangeset
for help on using the changeset viewer.