Changeset 51367 for trunk/tests/phpunit/tests/comment/query.php
- Timestamp:
- 07/07/2021 10:32:56 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/query.php
r51331 r51367 1292 1292 1293 1293 $comments = get_comments( array( 'post_id' => $post_id ) ); 1294 $this->assert Same( $limit, count( $comments ));1294 $this->assertCount( $limit, $comments ); 1295 1295 foreach ( $comments as $comment ) { 1296 1296 $this->assertEquals( $post_id, $comment->comment_post_ID ); … … 1301 1301 1302 1302 $comments = get_comments( array( 'post_id' => $post_id2 ) ); 1303 $this->assert Same( $limit, count( $comments ));1303 $this->assertCount( $limit, $comments ); 1304 1304 foreach ( $comments as $comment ) { 1305 1305 $this->assertEquals( $post_id2, $comment->comment_post_ID ); … … 1310 1310 1311 1311 $comments = get_comments( array( 'post_id' => $post_id3 ) ); 1312 $this->assert Same( $limit, count( $comments ));1312 $this->assertCount( $limit, $comments ); 1313 1313 foreach ( $comments as $comment ) { 1314 1314 $this->assertEquals( $post_id3, $comment->comment_post_ID ); … … 1321 1321 ) 1322 1322 ); 1323 $this->assert Same( $limit, count( $comments ));1323 $this->assertCount( $limit, $comments ); 1324 1324 foreach ( $comments as $comment ) { 1325 1325 $this->assertEquals( $post_id3, $comment->comment_post_ID ); … … 1332 1332 ) 1333 1333 ); 1334 $this->assert Same( 0, count( $comments ));1334 $this->assertCount( 0, $comments ); 1335 1335 1336 1336 self::factory()->comment->create_post_comments( $post_id3, $limit, array( 'comment_approved' => '1' ) ); 1337 1337 $comments = get_comments( array( 'post_id' => $post_id3 ) ); 1338 $this->assert Same( $limit * 2, count( $comments ));1338 $this->assertCount( $limit * 2, $comments ); 1339 1339 foreach ( $comments as $comment ) { 1340 1340 $this->assertEquals( $post_id3, $comment->comment_post_ID ); … … 1363 1363 ) 1364 1364 ); 1365 $this->assert Same( 2, count( $comments ));1365 $this->assertCount( 2, $comments ); 1366 1366 $this->assertEquals( $comment_id2, $comments[0]->comment_ID ); 1367 1367 $this->assertEquals( $comment_id, $comments[1]->comment_ID ); … … 1373 1373 ) 1374 1374 ); 1375 $this->assert Same( 2, count( $comments ));1375 $this->assertCount( 2, $comments ); 1376 1376 $this->assertEquals( $comment_id2, $comments[0]->comment_ID ); 1377 1377 $this->assertEquals( $comment_id, $comments[1]->comment_ID ); … … 1384 1384 ) 1385 1385 ); 1386 $this->assert Same( 2, count( $comments ));1386 $this->assertCount( 2, $comments ); 1387 1387 $this->assertEquals( $comment_id, $comments[0]->comment_ID ); 1388 1388 $this->assertEquals( $comment_id2, $comments[1]->comment_ID ); … … 1395 1395 ) 1396 1396 ); 1397 $this->assert Same( 2, count( $comments ));1397 $this->assertCount( 2, $comments ); 1398 1398 $this->assertEquals( $comment_id, $comments[0]->comment_ID ); 1399 1399 $this->assertEquals( $comment_id2, $comments[1]->comment_ID ); … … 1423 1423 ) 1424 1424 ); 1425 $this->assert Same( 1, count( $comments ));1425 $this->assertCount( 1, $comments ); 1426 1426 1427 1427 $comments = get_comments( … … 1431 1431 ) 1432 1432 ); 1433 $this->assert Same( 1, count( $comments ));1433 $this->assertCount( 1, $comments ); 1434 1434 } 1435 1435
Note: See TracChangeset
for help on using the changeset viewer.