Changeset 51367
- Timestamp:
- 07/07/2021 10:32:56 AM (4 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 63 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesScreen.php
r50449 r51367 392 392 393 393 $tabs = $screen->get_help_tabs(); 394 $this->assert Same( 4, count( $tabs ));394 $this->assertCount( 4, $tabs ); 395 395 $this->assertArrayHasKey( $tab_1, $tabs ); 396 396 $this->assertArrayHasKey( $tab_2, $tabs ); … … 412 412 $screen->remove_help_tab( $tab_1 ); 413 413 $this->assertNull( $screen->get_help_tab( $tab_1 ) ); 414 $this->assert Same( 3, count( $screen->get_help_tabs()) );414 $this->assertCount( 3, $screen->get_help_tabs() ); 415 415 416 416 $screen->remove_help_tab( $tab_2 ); 417 417 $this->assertNull( $screen->get_help_tab( $tab_2 ) ); 418 $this->assert Same( 2, count( $screen->get_help_tabs()) );418 $this->assertCount( 2, $screen->get_help_tabs() ); 419 419 420 420 $screen->remove_help_tab( $tab_3 ); 421 421 $this->assertNull( $screen->get_help_tab( $tab_3 ) ); 422 $this->assert Same( 1, count( $screen->get_help_tabs()) );422 $this->assertCount( 1, $screen->get_help_tabs() ); 423 423 424 424 $screen->remove_help_tab( $tab_4 ); 425 425 $this->assertNull( $screen->get_help_tab( $tab_4 ) ); 426 $this->assert Same( 0, count( $screen->get_help_tabs()) );426 $this->assertCount( 0, $screen->get_help_tabs() ); 427 427 428 428 $screen->remove_help_tabs(); -
trunk/tests/phpunit/tests/ajax/CustomizeMenus.php
r49696 r51367 580 580 if ( isset( $post_args['search'] ) && 'test' === $post_args['search'] ) { 581 581 $this->assertTrue( $response['success'] ); 582 $this->assert Same( 6, count( $response['data']['items'] ));582 $this->assertCount( 6, $response['data']['items'] ); 583 583 $item_ids = wp_list_pluck( $response['data']['items'], 'id' ); 584 584 $this->assertContains( 'post-' . $included_auto_draft_post->ID, $item_ids ); -
trunk/tests/phpunit/tests/blocks/block-list.php
r50450 r51367 107 107 $blocks = new WP_Block_List( $parsed_blocks, $context, $this->registry ); 108 108 109 $this->assert Same( 1, count( $blocks ));109 $this->assertCount( 1, $blocks ); 110 110 } 111 111 -
trunk/tests/phpunit/tests/category.php
r48937 r51367 30 30 // Validate length is 1 + created due to uncategorized. 31 31 $cat_ids = get_all_category_ids(); 32 $this->assert Same( 3, count( $cat_ids ));32 $this->assertCount( 3, $cat_ids ); 33 33 } 34 34 -
trunk/tests/phpunit/tests/comment.php
r50375 r51367 1266 1266 1267 1267 // Number of exported comments. 1268 $this->assert Same( 1, count( $actual['data'] ));1268 $this->assertCount( 1, $actual['data'] ); 1269 1269 1270 1270 // Number of exported comment properties. 1271 $this->assert Same( 8, count( $actual['data'][0]['data'] ));1271 $this->assertCount( 8, $actual['data'][0]['data'] ); 1272 1272 1273 1273 // Exported group. … … 1329 1329 1330 1330 // Number of exported comments. 1331 $this->assert Same( 1, count( $actual['data'] ));1331 $this->assertCount( 1, $actual['data'] ); 1332 1332 1333 1333 // Number of exported comment properties. 1334 $this->assert Same( 7, count( $actual['data'][0]['data'] ));1334 $this->assertCount( 7, $actual['data'][0]['data'] ); 1335 1335 } 1336 1336 … … 1360 1360 1361 1361 // Number of exported comments. 1362 $this->assert Same( 0, count( $actual['data'] ));1362 $this->assertCount( 0, $actual['data'] ); 1363 1363 } 1364 1364 } -
trunk/tests/phpunit/tests/comment/getCommentExcerpt.php
r50449 r51367 17 17 $excerpt = get_comment_excerpt( $comment_id ); 18 18 19 $this->assert Same( 20, count( explode( ' ', $excerpt )) );19 $this->assertCount( 20, explode( ' ', $excerpt ) ); 20 20 } 21 21 … … 31 31 $excerpt = get_comment_excerpt( $comment_id ); 32 32 33 $this->assert Same( 10, count( explode( ' ', $excerpt )) );33 $this->assertCount( 10, explode( ' ', $excerpt ) ); 34 34 } 35 35 -
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 -
trunk/tests/phpunit/tests/feed/rss2.php
r50337 r51367 107 107 108 108 // There should only be one <rss> child element. 109 $this->assert Same( 1, count( $rss ));109 $this->assertCount( 1, $rss ); 110 110 111 111 $this->assertSame( '2.0', $rss[0]['attributes']['version'] ); … … 115 115 116 116 // RSS should have exactly one child element (channel). 117 $this->assert Same( 1, count( $rss[0]['child'] ));117 $this->assertCount( 1, $rss[0]['child'] ); 118 118 } 119 119 … … 321 321 322 322 // There should only be one <rss> child element. 323 $this->assert Same( 1, count( $rss ));323 $this->assertCount( 1, $rss ); 324 324 } 325 325 … … 349 349 350 350 // There should only be one <rss> child element. 351 $this->assert Same( 1, count( $rss ));351 $this->assertCount( 1, $rss ); 352 352 } 353 353 … … 382 382 383 383 // There should only be one <rss> child element. 384 $this->assert Same( 1, count( $rss ));384 $this->assertCount( 1, $rss ); 385 385 } 386 386 … … 410 410 411 411 // There should only be one <rss> child element. 412 $this->assert Same( 1, count( $rss ));412 $this->assertCount( 1, $rss ); 413 413 } 414 414 … … 438 438 439 439 // There should only be one <rss> child element. 440 $this->assert Same( 1, count( $rss ));440 $this->assertCount( 1, $rss ); 441 441 } 442 442 … … 466 466 467 467 // There should only be one <rss> child element. 468 $this->assert Same( 1, count( $rss ));468 $this->assertCount( 1, $rss ); 469 469 } 470 470 -
trunk/tests/phpunit/tests/functions/wpListFilter.php
r49184 r51367 52 52 'AND' 53 53 ); 54 $this->assert Same( 2, count( $list ));54 $this->assertCount( 2, $list ); 55 55 $this->assertArrayHasKey( 'foo', $list ); 56 56 $this->assertArrayHasKey( 'bar', $list ); … … 66 66 'OR' 67 67 ); 68 $this->assert Same( 3, count( $list ));68 $this->assertCount( 3, $list ); 69 69 $this->assertArrayHasKey( 'foo', $list ); 70 70 $this->assertArrayHasKey( 'bar', $list ); … … 81 81 'NOT' 82 82 ); 83 $this->assert Same( 1, count( $list ));83 $this->assertCount( 1, $list ); 84 84 $this->assertArrayHasKey( 'baz', $list ); 85 85 } … … 289 289 function test_filter_object_list_nested_array_and() { 290 290 $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'AND' ); 291 $this->assert Same( 1, count( $list ));291 $this->assertCount( 1, $list ); 292 292 $this->assertArrayHasKey( 'baz', $list ); 293 293 } … … 295 295 function test_filter_object_list_nested_array_not() { 296 296 $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'red' ) ), 'NOT' ); 297 $this->assert Same( 2, count( $list ));297 $this->assertCount( 2, $list ); 298 298 $this->assertArrayHasKey( 'bar', $list ); 299 299 $this->assertArrayHasKey( 'baz', $list ); … … 309 309 'OR' 310 310 ); 311 $this->assert Same( 2, count( $list ));311 $this->assertCount( 2, $list ); 312 312 $this->assertArrayHasKey( 'foo', $list ); 313 313 $this->assertArrayHasKey( 'baz', $list ); … … 316 316 function test_filter_object_list_nested_array_or_singular() { 317 317 $list = wp_filter_object_list( $this->object_list, array( 'field4' => array( 'blue' ) ), 'OR' ); 318 $this->assert Same( 1, count( $list ));318 $this->assertCount( 1, $list ); 319 319 $this->assertArrayHasKey( 'baz', $list ); 320 320 } -
trunk/tests/phpunit/tests/import/import.php
r50463 r51367 86 86 ) 87 87 ); 88 $this->assert Same( 11, count( $posts ));88 $this->assertCount( 11, $posts ); 89 89 90 90 $post = $posts[0]; … … 96 96 $this->assertSame( 0, $post->post_parent ); 97 97 $cats = wp_get_post_categories( $post->ID ); 98 $this->assert Same( 27, count( $cats ));98 $this->assertCount( 27, $cats ); 99 99 100 100 $post = $posts[1]; … … 106 106 $this->assertSame( 0, $post->post_parent ); 107 107 $cats = wp_get_post_categories( $post->ID ); 108 $this->assert Same( 1, count( $cats ));108 $this->assertCount( 1, $cats ); 109 109 $this->assertTrue( has_post_format( 'aside', $post->ID ) ); 110 110 … … 117 117 $this->assertSame( 0, $post->post_parent ); 118 118 $cats = wp_get_post_categories( $post->ID, array( 'fields' => 'all' ) ); 119 $this->assert Same( 1, count( $cats ));119 $this->assertCount( 1, $cats ); 120 120 $this->assertSame( 'foo', $cats[0]->slug ); 121 121 … … 128 128 $this->assertSame( 0, $post->post_parent ); 129 129 $cats = wp_get_post_categories( $post->ID, array( 'fields' => 'all' ) ); 130 $this->assert Same( 1, count( $cats ));130 $this->assertCount( 1, $cats ); 131 131 $this->assertSame( 'foo-bar', $cats[0]->slug ); 132 132 … … 139 139 $this->assertSame( 0, $post->post_parent ); 140 140 $cats = wp_get_post_categories( $post->ID ); 141 $this->assert Same( 1, count( $cats ));141 $this->assertCount( 1, $cats ); 142 142 $tags = wp_get_post_tags( $post->ID ); 143 $this->assert Same( 3, count( $tags ));143 $this->assertCount( 3, $tags ); 144 144 $this->assertSame( 'tag1', $tags[0]->slug ); 145 145 $this->assertSame( 'tag2', $tags[1]->slug ); … … 199 199 $this->assertSame( 0, $post->post_parent ); 200 200 $cats = wp_get_post_categories( $post->ID ); 201 $this->assert Same( 1, count( $cats ));201 $this->assertCount( 1, $cats ); 202 202 } 203 203 -
trunk/tests/phpunit/tests/import/parser.php
r51335 r51367 107 107 ); 108 108 109 $this->assert Same( 2, count( $result['posts'] ), $message );110 $this->assert Same( 19, count( $result['posts'][0] ), $message );111 $this->assert Same( 18, count( $result['posts'][1] ), $message );109 $this->assertCount( 2, $result['posts'], $message ); 110 $this->assertCount( 19, $result['posts'][0], $message ); 111 $this->assertCount( 18, $result['posts'][1], $message ); 112 112 $this->assertEquals( 113 113 array( … … 161 161 $this->assertSame( $result['tags'][0]['tag_name'], 'chicken', $message ); 162 162 163 $this->assert Same( 6, count( $result['posts'] ), $message );164 $this->assert Same( 19, count( $result['posts'][0] ), $message );165 $this->assert Same( 18, count( $result['posts'][1] ), $message );163 $this->assertCount( 6, $result['posts'], $message ); 164 $this->assertCount( 19, $result['posts'][0], $message ); 165 $this->assertCount( 18, $result['posts'][1], $message ); 166 166 167 167 $this->assertEquals( -
trunk/tests/phpunit/tests/meta.php
r51331 r51367 101 101 102 102 foreach ( $found as $action => $mids ) { 103 $this->assert Same( 2, count( $mids ));103 $this->assertCount( 2, $mids ); 104 104 } 105 105 } … … 138 138 ); 139 139 140 $this->assert Same( 1, count( $u ));140 $this->assertCount( 1, $u ); 141 141 142 142 // User found is not locally defined author (it's the admin). -
trunk/tests/phpunit/tests/multisite/networkQuery.php
r49603 r51367 71 71 ); 72 72 73 $this->assert Same( 3, count( $found ));73 $this->assertCount( 3, $found ); 74 74 } 75 75 -
trunk/tests/phpunit/tests/multisite/siteQuery.php
r49603 r51367 136 136 ); 137 137 138 $this->assert Same( 3, count( $found ));138 $this->assertCount( 3, $found ); 139 139 } 140 140 -
trunk/tests/phpunit/tests/pomo/mo.php
r48937 r51367 16 16 $mo->headers 17 17 ); 18 $this->assert Same( 2, count( $mo->entries ));18 $this->assertCount( 2, $mo->entries ); 19 19 $this->assertSame( array( 'dyado' ), $mo->entries['baba']->translations ); 20 20 $this->assertSame( array( 'yes' ), $mo->entries["kuku\nruku"]->translations ); … … 24 24 $mo = new MO(); 25 25 $mo->import_from_file( DIR_TESTDATA . '/pomo/plural.mo' ); 26 $this->assert Same( 1, count( $mo->entries ));26 $this->assertCount( 1, $mo->entries ); 27 27 $this->assertSame( array( 'oney dragoney', 'twoey dragoney', 'manyey dragoney', 'manyeyey dragoney', 'manyeyeyey dragoney' ), $mo->entries['one dragon']->translations ); 28 28 … … 50 50 $mo = new MO(); 51 51 $mo->import_from_file( DIR_TESTDATA . '/pomo/context.mo' ); 52 $this->assert Same( 2, count( $mo->entries ));52 $this->assertCount( 2, $mo->entries ); 53 53 $plural_entry = new Translation_Entry( 54 54 array( … … 82 82 $guest->add_entry( new Translation_Entry( array( 'singular' => 'red' ) ) ); 83 83 $host->merge_with( $guest ); 84 $this->assert Same( 3, count( $host->entries ));84 $this->assertCount( 3, $host->entries ); 85 85 $this->assertSame( array(), array_diff( array( 'pink', 'green', 'red' ), array_keys( $host->entries ) ) ); 86 86 } … … 160 160 $again->import_from_file( $temp_fn ); 161 161 162 $this->assert Same( 0, count( $again->entries ));162 $this->assertCount( 0, $again->entries ); 163 163 } 164 164 -
trunk/tests/phpunit/tests/pomo/po.php
r48937 r51367 318 318 $po = new PO(); 319 319 $this->assertTrue( $po->import_from_file( DIR_TESTDATA . '/pomo/windows-line-endings.po' ) ); 320 $this->assert Same( 1, count( $po->entries ));320 $this->assertCount( 1, $po->entries ); 321 321 } 322 322 -
trunk/tests/phpunit/tests/post.php
r51331 r51367 99 99 $tcache = wp_cache_get( $id, 'post_tag_relationships' ); 100 100 $this->assertIsArray( $tcache ); 101 $this->assert Same( 2, count( $tcache ));101 $this->assertCount( 2, $tcache ); 102 102 103 103 $tcache = wp_cache_get( $id, 'ctax_relationships' ); 104 104 if ( 'cpt' === $post_type ) { 105 105 $this->assertIsArray( $tcache ); 106 $this->assert Same( 2, count( $tcache ));106 $this->assertCount( 2, $tcache ); 107 107 } else { 108 108 $this->assertFalse( $tcache ); … … 918 918 919 919 preg_match_all( '|href="([^"]+)"|', $wp_tag_cloud, $matches ); 920 $this->assert Same( 1, count( $matches[1] ));920 $this->assertCount( 1, $matches[1] ); 921 921 922 922 $terms = get_terms( $tax ); -
trunk/tests/phpunit/tests/post/formats.php
r51331 r51367 14 14 $this->assertNotWPError( $result ); 15 15 $this->assertIsArray( $result ); 16 $this->assert Same( 1, count( $result ));16 $this->assertCount( 1, $result ); 17 17 18 18 $format = get_post_format( $post_id ); … … 22 22 $this->assertNotWPError( $result ); 23 23 $this->assertIsArray( $result ); 24 $this->assert Same( 0, count( $result ));24 $this->assertCount( 0, $result ); 25 25 26 26 $result = set_post_format( $post_id, '' ); 27 27 $this->assertNotWPError( $result ); 28 28 $this->assertIsArray( $result ); 29 $this->assert Same( 0, count( $result ));29 $this->assertCount( 0, $result ); 30 30 } 31 31 … … 42 42 $this->assertNotWPError( $result ); 43 43 $this->assertIsArray( $result ); 44 $this->assert Same( 1, count( $result ));44 $this->assertCount( 1, $result ); 45 45 // The format can be set but not retrieved until it is registered. 46 46 $format = get_post_format( $post_id ); … … 55 55 $this->assertNotWPError( $result ); 56 56 $this->assertIsArray( $result ); 57 $this->assert Same( 0, count( $result ));57 $this->assertCount( 0, $result ); 58 58 59 59 $result = set_post_format( $post_id, '' ); 60 60 $this->assertNotWPError( $result ); 61 61 $this->assertIsArray( $result ); 62 $this->assert Same( 0, count( $result ));62 $this->assertCount( 0, $result ); 63 63 64 64 remove_post_type_support( 'page', 'post-formats' ); … … 74 74 $this->assertNotWPError( $result ); 75 75 $this->assertIsArray( $result ); 76 $this->assert Same( 1, count( $result ));76 $this->assertCount( 1, $result ); 77 77 $this->assertTrue( has_post_format( 'aside', $post_id ) ); 78 78 … … 80 80 $this->assertNotWPError( $result ); 81 81 $this->assertIsArray( $result ); 82 $this->assert Same( 0, count( $result ));82 $this->assertCount( 0, $result ); 83 83 // Standard is a special case. It shows as false when set. 84 84 $this->assertFalse( has_post_format( 'standard', $post_id ) ); -
trunk/tests/phpunit/tests/post/getPages.php
r50449 r51367 17 17 18 18 $pages = get_pages(); 19 $this->assert Same( 3, count( $pages ));19 $this->assertCount( 3, $pages ); 20 20 $time1 = wp_cache_get( 'last_changed', 'posts' ); 21 21 $this->assertNotEmpty( $time1 ); … … 27 27 // Again. num_queries and last_changed should remain the same. 28 28 $pages = get_pages(); 29 $this->assert Same( 3, count( $pages ));29 $this->assertCount( 3, $pages ); 30 30 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 31 31 $this->assertSame( $num_queries, $wpdb->num_queries ); … … 37 37 // different args to get_pages(). num_queries should bump by 1. 38 38 $pages = get_pages( array( 'number' => 2 ) ); 39 $this->assert Same( 2, count( $pages ));39 $this->assertCount( 2, $pages ); 40 40 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 41 41 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); … … 48 48 // Again. num_queries and last_changed should remain the same. 49 49 $pages = get_pages( array( 'number' => 2 ) ); 50 $this->assert Same( 2, count( $pages ));50 $this->assertCount( 2, $pages ); 51 51 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 52 52 $this->assertSame( $num_queries, $wpdb->num_queries ); … … 57 57 // Do the first query again. The interim queries should not affect it. 58 58 $pages = get_pages(); 59 $this->assert Same( 3, count( $pages ));59 $this->assertCount( 3, $pages ); 60 60 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'posts' ) ); 61 61 $this->assertSame( $num_queries, $wpdb->num_queries ); … … 72 72 // last_changed bumped so num_queries should increment. 73 73 $pages = get_pages( array( 'number' => 2 ) ); 74 $this->assert Same( 2, count( $pages ));74 $this->assertCount( 2, $pages ); 75 75 $this->assertSame( $time2, wp_cache_get( 'last_changed', 'posts' ) ); 76 76 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); … … 92 92 // num_queries should bump after wp_delete_post() bumps last_changed. 93 93 $pages = get_pages(); 94 $this->assert Same( 2, count( $pages ));94 $this->assertCount( 2, $pages ); 95 95 $this->assertSame( $last_changed, wp_cache_get( 'last_changed', 'posts' ) ); 96 96 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); … … 278 278 ) 279 279 ); 280 $this->assert Same( 3, count( get_pages( array( 'meta_key' => 'some-meta-key' )) ) );280 $this->assertCount( 3, get_pages( array( 'meta_key' => 'some-meta-key' ) ) ); 281 281 } 282 282 … … 373 373 preg_match_all( '#<option#', wp_dropdown_pages( 'echo=0' ), $matches ); 374 374 375 $this->assert Same( 5, count( $matches[0] ));375 $this->assertCount( 5, $matches[0] ); 376 376 } 377 377 -
trunk/tests/phpunit/tests/post/objects.php
r51331 r51367 114 114 115 115 $this->assertIsArray( $post->post_category ); 116 $this->assert Same( 1, count( $post->post_category ));116 $this->assertCount( 1, $post->post_category ); 117 117 $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] ); 118 118 $term1 = wp_insert_term( 'Foo', 'category' ); … … 120 120 $term3 = wp_insert_term( 'Baz', 'category' ); 121 121 wp_set_post_categories( $post_id, array( $term1['term_id'], $term2['term_id'], $term3['term_id'] ) ); 122 $this->assert Same( 3, count( $post->post_category ));122 $this->assertCount( 3, $post->post_category ); 123 123 $this->assertSame( array( $term2['term_id'], $term3['term_id'], $term1['term_id'] ), $post->post_category ); 124 124 125 125 $post = get_post( $post_id, ARRAY_A ); 126 $this->assert Same( 3, count( $post['post_category'] ));126 $this->assertCount( 3, $post['post_category'] ); 127 127 $this->assertSame( array( $term2['term_id'], $term3['term_id'], $term1['term_id'] ), $post['post_category'] ); 128 128 } … … 136 136 wp_set_post_tags( $post_id, 'Foo, Bar, Baz' ); 137 137 $this->assertIsArray( $post->tags_input ); 138 $this->assert Same( 3, count( $post->tags_input ));138 $this->assertCount( 3, $post->tags_input ); 139 139 $this->assertSame( array( 'Bar', 'Baz', 'Foo' ), $post->tags_input ); 140 140 141 141 $post = get_post( $post_id, ARRAY_A ); 142 142 $this->assertIsArray( $post['tags_input'] ); 143 $this->assert Same( 3, count( $post['tags_input'] ));143 $this->assertCount( 3, $post['tags_input'] ); 144 144 $this->assertSame( array( 'Bar', 'Baz', 'Foo' ), $post['tags_input'] ); 145 145 } -
trunk/tests/phpunit/tests/post/query.php
r51331 r51367 97 97 98 98 // Fourth post added in filter. 99 $this->assert Same( 4, count( $query->posts ));99 $this->assertCount( 4, $query->posts ); 100 100 $this->assertSame( 4, $query->post_count ); 101 101 -
trunk/tests/phpunit/tests/post/types.php
r51331 r51367 350 350 $this->assertNotContains( '%foo%', $wp_rewrite->rewritecode ); 351 351 $this->assertNotContains( 'bar=', $wp_rewrite->queryreplace ); 352 $this->assert Same( --$count_before, count( $wp_rewrite->rewritereplace )); // Array was reduced by one value.352 $this->assertCount( --$count_before, $wp_rewrite->rewritereplace ); // Array was reduced by one value. 353 353 } 354 354 … … 462 462 463 463 $this->assertArrayHasKey( 'future_foo', $wp_filter ); 464 $this->assert Same( 1, count( $wp_filter['future_foo']->callbacks ));464 $this->assertCount( 1, $wp_filter['future_foo']->callbacks ); 465 465 $this->assertTrue( unregister_post_type( 'foo' ) ); 466 466 $this->assertArrayNotHasKey( 'future_foo', $wp_filter ); … … 482 482 483 483 $this->assertArrayHasKey( 'add_meta_boxes_foo', $wp_filter ); 484 $this->assert Same( 1, count( $wp_filter['add_meta_boxes_foo']->callbacks ));484 $this->assertCount( 1, $wp_filter['add_meta_boxes_foo']->callbacks ); 485 485 $this->assertTrue( unregister_post_type( 'foo' ) ); 486 486 $this->assertArrayNotHasKey( 'add_meta_boxes_foo', $wp_filter ); -
trunk/tests/phpunit/tests/query/metaQuery.php
r48939 r51367 697 697 ); 698 698 699 $this->assert Same( 0, count( $query->posts ));699 $this->assertCount( 0, $query->posts ); 700 700 } 701 701 … … 1535 1535 1536 1536 $query = new WP_Query( $args ); 1537 $this->assert Same( 2, count( $query->posts ));1537 $this->assertCount( 2, $query->posts ); 1538 1538 foreach ( $query->posts as $post ) { 1539 1539 $this->assertInstanceOf( 'WP_Post', $post ); … … 1551 1551 1552 1552 $query = new WP_Query( $args ); 1553 $this->assert Same( 3, count( $query->posts ));1553 $this->assertCount( 3, $query->posts ); 1554 1554 foreach ( $query->posts as $post ) { 1555 1555 $this->assertInstanceOf( 'WP_Post', $post ); … … 1583 1583 ); 1584 1584 1585 $this->assert Same( 2, count( $posts ));1585 $this->assertCount( 2, $posts ); 1586 1586 $posts = wp_list_pluck( $posts, 'ID' ); 1587 1587 $this->assertSameSets( array( $post_id, $post_id3 ), $posts ); … … 1595 1595 ); 1596 1596 1597 $this->assert Same( 2, count( $posts ));1597 $this->assertCount( 2, $posts ); 1598 1598 foreach ( $posts as $post ) { 1599 1599 $this->assertInstanceOf( 'WP_Post', $post ); … … 1626 1626 1627 1627 $posts = get_posts( $args ); 1628 $this->assert Same( 2, count( $posts ));1628 $this->assertCount( 2, $posts ); 1629 1629 foreach ( $posts as $post ) { 1630 1630 $this->assertInstanceOf( 'WP_Post', $post ); … … 1660 1660 ) 1661 1661 ); 1662 $this->assert Same( 1, count( $q->posts ));1662 $this->assertCount( 1, $q->posts ); 1663 1663 foreach ( $q->posts as $post ) { 1664 1664 $this->assertInstanceOf( 'WP_Post', $post ); … … 1673 1673 ) 1674 1674 ); 1675 $this->assert Same( 2, count( $posts ));1675 $this->assertCount( 2, $posts ); 1676 1676 foreach ( $posts as $post ) { 1677 1677 $this->assertInstanceOf( 'WP_Post', $post ); … … 1687 1687 ) 1688 1688 ); 1689 $this->assert Same( 2, count( $posts ));1689 $this->assertCount( 2, $posts ); 1690 1690 foreach ( $posts as $post ) { 1691 1691 $this->assertInstanceOf( 'WP_Post', $post ); … … 1696 1696 1697 1697 $posts = get_posts( array( 'meta_value' => 0 ) ); 1698 $this->assert Same( 5, count( $posts ));1698 $this->assertCount( 5, $posts ); 1699 1699 foreach ( $posts as $post ) { 1700 1700 $this->assertInstanceOf( 'WP_Post', $post ); … … 1705 1705 1706 1706 $posts = get_posts( array( 'meta_value' => '0' ) ); 1707 $this->assert Same( 5, count( $posts ));1707 $this->assertCount( 5, $posts ); 1708 1708 foreach ( $posts as $post ) { 1709 1709 $this->assertInstanceOf( 'WP_Post', $post ); -
trunk/tests/phpunit/tests/query/taxQuery.php
r48939 r51367 1026 1026 1027 1027 $posts = $query->get_posts(); 1028 $this->assert Same( 0, count( $posts ));1028 $this->assertCount( 0, $posts ); 1029 1029 } 1030 1030 … … 1061 1061 1062 1062 $posts = $query->get_posts(); 1063 $this->assert Same( 0, count( $posts ));1063 $this->assertCount( 0, $posts ); 1064 1064 } 1065 1065 … … 1113 1113 ); 1114 1114 1115 $this->assert Same( 4, count( $posts ));1115 $this->assertCount( 4, $posts ); 1116 1116 1117 1117 $posts = get_posts( … … 1131 1131 ); 1132 1132 1133 $this->assert Same( 1, count( $posts ));1133 $this->assertCount( 1, $posts ); 1134 1134 1135 1135 $posts = get_posts( … … 1148 1148 ); 1149 1149 1150 $this->assert Same( 3, count( $posts ));1150 $this->assertCount( 3, $posts ); 1151 1151 1152 1152 $posts = get_posts( … … 1166 1166 ); 1167 1167 1168 $this->assert Same( 1, count( $posts ));1168 $this->assertCount( 1, $posts ); 1169 1169 1170 1170 $posts = get_posts( … … 1183 1183 ); 1184 1184 1185 $this->assert Same( 1, count( $posts ));1185 $this->assertCount( 1, $posts ); 1186 1186 1187 1187 $posts = get_posts( … … 1201 1201 ); 1202 1202 1203 $this->assert Same( 1, count( $posts ));1203 $this->assertCount( 1, $posts ); 1204 1204 } 1205 1205 -
trunk/tests/phpunit/tests/rest-api/rest-attachments-controller.php
r51331 r51367 416 416 $request = new WP_REST_Request( 'GET', '/wp/v2/media' ); 417 417 $response = rest_get_server()->dispatch( $request ); 418 $this->assert Same( 2, count( $response->get_data()) );418 $this->assertCount( 2, $response->get_data() ); 419 419 $request = new WP_REST_Request( 'GET', '/wp/v2/media' ); 420 420 // Attachments without a parent. … … 422 422 $response = rest_get_server()->dispatch( $request ); 423 423 $data = $response->get_data(); 424 $this->assert Same( 1, count( $data ));424 $this->assertCount( 1, $data ); 425 425 $this->assertSame( $attachment_id2, $data[0]['id'] ); 426 426 // Attachments with parent=post_id. … … 429 429 $response = rest_get_server()->dispatch( $request ); 430 430 $data = $response->get_data(); 431 $this->assert Same( 1, count( $data ));431 $this->assertCount( 1, $data ); 432 432 $this->assertSame( $attachment_id, $data[0]['id'] ); 433 433 // Attachments with invalid parent. … … 436 436 $response = rest_get_server()->dispatch( $request ); 437 437 $data = $response->get_data(); 438 $this->assert Same( 0, count( $data ));438 $this->assertCount( 0, $data ); 439 439 } 440 440 … … 510 510 $this->assertSame( 200, $response->get_status() ); 511 511 $data = $response->get_data(); 512 $this->assert Same( 2, count( $data ));512 $this->assertCount( 2, $data ); 513 513 $ids = array( 514 514 $data[0]['id'], … … 1466 1466 $data = $response->get_data(); 1467 1467 $properties = $data['schema']['properties']; 1468 $this->assert Same( 27, count( $properties ));1468 $this->assertCount( 27, $properties ); 1469 1469 $this->assertArrayHasKey( 'author', $properties ); 1470 1470 $this->assertArrayHasKey( 'alt_text', $properties ); -
trunk/tests/phpunit/tests/rest-api/rest-autosaves-controller.php
r49606 r51367 287 287 $data = $response->get_data(); 288 288 $properties = $data['schema']['properties']; 289 $this->assert Same( 13, count( $properties ));289 $this->assertCount( 13, $properties ); 290 290 $this->assertArrayHasKey( 'author', $properties ); 291 291 $this->assertArrayHasKey( 'content', $properties ); -
trunk/tests/phpunit/tests/rest-api/rest-block-type-controller.php
r50527 r51367 342 342 $this->assertSame( $block_type, $data['name'] ); 343 343 $this->assertArrayHasKey( 'variations', $data ); 344 $this->assert Same( 1, count( $data['variations'] ));344 $this->assertCount( 1, $data['variations'] ); 345 345 $variation = $data['variations'][0]; 346 346 $this->assertSame( 'variation title', $variation['title'] ); -
trunk/tests/phpunit/tests/rest-api/rest-categories-controller.php
r50463 r51367 184 184 $response = rest_get_server()->dispatch( $request ); 185 185 $data = $response->get_data(); 186 $this->assert Same( 2, count( $data ));186 $this->assertCount( 2, $data ); 187 187 $this->assertSame( 'Season 5', $data[0]['name'] ); 188 188 $this->assertSame( 'The Be Sharps', $data[1]['name'] ); … … 192 192 $response = rest_get_server()->dispatch( $request ); 193 193 $data = $response->get_data(); 194 $this->assert Same( $total_categories, count( $data ));194 $this->assertCount( $total_categories, $data ); 195 195 } 196 196 … … 292 292 $response = rest_get_server()->dispatch( $request ); 293 293 $data = $response->get_data(); 294 $this->assert Same( 2, count( $data ));294 $this->assertCount( 2, $data ); 295 295 $this->assertSame( $id1, $data[0]['id'] ); 296 296 … … 299 299 $response = rest_get_server()->dispatch( $request ); 300 300 $data = $response->get_data(); 301 $this->assert Same( 2, count( $data ));301 $this->assertCount( 2, $data ); 302 302 $this->assertSame( $id2, $data[0]['id'] ); 303 303 } … … 340 340 $this->assertSame( 200, $response->get_status() ); 341 341 $data = $response->get_data(); 342 $this->assert Same( 1, count( $data ));342 $this->assertCount( 1, $data ); 343 343 $this->assertSame( 'Uncategorized', $data[0]['name'] ); 344 344 … … 350 350 $this->assertSame( 200, $response->get_status() ); 351 351 $data = $response->get_data(); 352 $this->assert Same( 2, count( $data ));352 $this->assertCount( 2, $data ); 353 353 $this->assertSame( 'Apple', $data[0]['name'] ); 354 354 } … … 440 440 441 441 $data = $response->get_data(); 442 $this->assert Same( 3, count( $data ));442 $this->assertCount( 3, $data ); 443 443 444 444 // Check ordered by name by default. … … 458 458 459 459 $data = $response->get_data(); 460 $this->assert Same( 3, count( $data ));460 $this->assertCount( 3, $data ); 461 461 $names = wp_list_pluck( $data, 'name' ); 462 462 $this->assertSame( array( 'Image', 'Marvel', 'DC' ), $names, 'Terms should be ordered by description' ); … … 468 468 469 469 $data = $response->get_data(); 470 $this->assert Same( 3, count( $data ));470 $this->assertCount( 3, $data ); 471 471 $names = wp_list_pluck( $data, 'name' ); 472 472 $this->assertSame( array( 'DC', 'Marvel', 'Image' ), $names, 'Terms should be reverse-ordered by description' ); … … 483 483 484 484 $data = $response->get_data(); 485 $this->assert Same( 3, count( $data ));485 $this->assertCount( 3, $data ); 486 486 $names = wp_list_pluck( $data, 'name' ); 487 487 $this->assertSame( array( 'DC', 'Marvel', 'Image' ), $names ); … … 519 519 520 520 $data = $response->get_data(); 521 $this->assert Same( 2, count( $data ));521 $this->assertCount( 2, $data ); 522 522 $this->assertSame( 'Cape', $data[0]['name'] ); 523 523 } … … 536 536 $this->assertSame( 200, $response->get_status() ); 537 537 $data = $response->get_data(); 538 $this->assert Same( 1, count( $data ));538 $this->assertCount( 1, $data ); 539 539 $this->assertSame( 'Apple', $data[0]['name'] ); 540 540 … … 544 544 $this->assertSame( 200, $response->get_status() ); 545 545 $data = $response->get_data(); 546 $this->assert Same( 0, count( $data ));546 $this->assertCount( 0, $data ); 547 547 } 548 548 … … 556 556 $this->assertSame( 200, $response->get_status() ); 557 557 $data = $response->get_data(); 558 $this->assert Same( 1, count( $data ));558 $this->assertCount( 1, $data ); 559 559 $this->assertSame( 'Apple', $data[0]['name'] ); 560 560 } … … 573 573 $response = rest_get_server()->dispatch( $request ); 574 574 $data = $response->get_data(); 575 $this->assert Same( 1, count( $data ));575 $this->assertCount( 1, $data ); 576 576 $this->assertSame( 'Child', $data[0]['name'] ); 577 577 } … … 1131 1131 $data = $response->get_data(); 1132 1132 $properties = $data['schema']['properties']; 1133 $this->assert Same( 9, count( $properties ));1133 $this->assertCount( 9, $properties ); 1134 1134 $this->assertArrayHasKey( 'id', $properties ); 1135 1135 $this->assertArrayHasKey( 'count', $properties ); -
trunk/tests/phpunit/tests/rest-api/rest-comments-controller.php
r51331 r51367 489 489 $response = rest_get_server()->dispatch( $request ); 490 490 $data = $response->get_data(); 491 $this->assert Same( 2, count( $data ));491 $this->assertCount( 2, $data ); 492 492 $this->assertSame( $id1, $data[0]['id'] ); 493 493 … … 496 496 $response = rest_get_server()->dispatch( $request ); 497 497 $data = $response->get_data(); 498 $this->assert Same( 2, count( $data ));498 $this->assertCount( 2, $data ); 499 499 $this->assertSame( $id2, $data[0]['id'] ); 500 500 … … 3157 3157 $data = $response->get_data(); 3158 3158 $properties = $data['schema']['properties']; 3159 $this->assert Same( 17, count( $properties ));3159 $this->assertCount( 17, $properties ); 3160 3160 $this->assertArrayHasKey( 'id', $properties ); 3161 3161 $this->assertArrayHasKey( 'author', $properties ); -
trunk/tests/phpunit/tests/rest-api/rest-pages-controller.php
r50463 r51367 110 110 $response = rest_get_server()->dispatch( $request ); 111 111 $data = $response->get_data(); 112 $this->assert Same( 1, count( $data ));112 $this->assertCount( 1, $data ); 113 113 $this->assertSame( $id1, $data[0]['id'] ); 114 114 } … … 133 133 $response = rest_get_server()->dispatch( $request ); 134 134 $data = $response->get_data(); 135 $this->assert Same( 2, count( $data ));135 $this->assertCount( 2, $data ); 136 136 137 137 // Filter to parent. … … 139 139 $response = rest_get_server()->dispatch( $request ); 140 140 $data = $response->get_data(); 141 $this->assert Same( 1, count( $data ));141 $this->assertCount( 1, $data ); 142 142 $this->assertSame( $id2, $data[0]['id'] ); 143 143 … … 180 180 $response = rest_get_server()->dispatch( $request ); 181 181 $data = $response->get_data(); 182 $this->assert Same( 4, count( $data ));182 $this->assertCount( 4, $data ); 183 183 184 184 // Filter to parents. … … 186 186 $response = rest_get_server()->dispatch( $request ); 187 187 $data = $response->get_data(); 188 $this->assert Same( 2, count( $data ));188 $this->assertCount( 2, $data ); 189 189 $this->assertSameSets( array( $id2, $id4 ), wp_list_pluck( $data, 'id' ) ); 190 190 } … … 209 209 $response = rest_get_server()->dispatch( $request ); 210 210 $data = $response->get_data(); 211 $this->assert Same( 2, count( $data ));211 $this->assertCount( 2, $data ); 212 212 213 213 // Filter to parent. … … 215 215 $response = rest_get_server()->dispatch( $request ); 216 216 $data = $response->get_data(); 217 $this->assert Same( 1, count( $data ));217 $this->assertCount( 1, $data ); 218 218 $this->assertSame( $id1, $data[0]['id'] ); 219 219 … … 559 559 560 560 $all_data = $response->get_data(); 561 $this->assert Same( 4, count( $all_data ));561 $this->assertCount( 4, $all_data ); 562 562 foreach ( $all_data as $post ) { 563 563 $this->assertSame( 'page', $post['type'] ); … … 738 738 $data = $response->get_data(); 739 739 $properties = $data['schema']['properties']; 740 $this->assert Same( 24, count( $properties ));740 $this->assertCount( 24, $properties ); 741 741 $this->assertArrayHasKey( 'author', $properties ); 742 742 $this->assertArrayHasKey( 'comment_status', $properties ); -
trunk/tests/phpunit/tests/rest-api/rest-post-statuses-controller.php
r48939 r51367 39 39 $data = $response->get_data(); 40 40 $statuses = get_post_stati( array( 'public' => true ), 'objects' ); 41 $this->assert Same( 1, count( $data ));41 $this->assertCount( 1, $data ); 42 42 $this->assertSame( 'publish', $data['publish']['slug'] ); 43 43 } … … 51 51 52 52 $data = $response->get_data(); 53 $this->assert Same( 6, count( $data ));53 $this->assertCount( 6, $data ); 54 54 $this->assertSameSets( 55 55 array( … … 154 154 $data = $response->get_data(); 155 155 $properties = $data['schema']['properties']; 156 $this->assert Same( 8, count( $properties ));156 $this->assertCount( 8, $properties ); 157 157 $this->assertArrayHasKey( 'name', $properties ); 158 158 $this->assertArrayHasKey( 'private', $properties ); -
trunk/tests/phpunit/tests/rest-api/rest-post-types-controller.php
r48939 r51367 145 145 $data = $response->get_data(); 146 146 $properties = $data['schema']['properties']; 147 $this->assert Same( 10, count( $properties ));147 $this->assertCount( 10, $properties ); 148 148 $this->assertArrayHasKey( 'capabilities', $properties ); 149 149 $this->assertArrayHasKey( 'description', $properties ); -
trunk/tests/phpunit/tests/rest-api/rest-posts-controller.php
r51137 r51367 269 269 $response = rest_get_server()->dispatch( $request ); 270 270 $this->assertSame( 200, $response->get_status() ); 271 $this->assert Same( $total_posts, count( $response->get_data()) );271 $this->assertCount( $total_posts, $response->get_data() ); 272 272 273 273 // Limit to editor and author. … … 277 277 $this->assertSame( 200, $response->get_status() ); 278 278 $data = $response->get_data(); 279 $this->assert Same( 2, count( $data ));279 $this->assertCount( 2, $data ); 280 280 $this->assertSameSets( array( self::$editor_id, self::$author_id ), wp_list_pluck( $data, 'author' ) ); 281 281 … … 286 286 $this->assertSame( 200, $response->get_status() ); 287 287 $data = $response->get_data(); 288 $this->assert Same( 1, count( $data ));288 $this->assertCount( 1, $data ); 289 289 $this->assertSame( self::$editor_id, $data[0]['author'] ); 290 290 } … … 301 301 $response = rest_get_server()->dispatch( $request ); 302 302 $this->assertSame( 200, $response->get_status() ); 303 $this->assert Same( $total_posts, count( $response->get_data()) );303 $this->assertCount( $total_posts, $response->get_data() ); 304 304 305 305 // Exclude editor and author. … … 310 310 $this->assertSame( 200, $response->get_status() ); 311 311 $data = $response->get_data(); 312 $this->assert Same( $total_posts - 2, count( $data ));312 $this->assertCount( $total_posts - 2, $data ); 313 313 $this->assertNotEquals( self::$editor_id, $data[0]['author'] ); 314 314 $this->assertNotEquals( self::$author_id, $data[0]['author'] ); … … 321 321 $this->assertSame( 200, $response->get_status() ); 322 322 $data = $response->get_data(); 323 $this->assert Same( $total_posts - 1, count( $data ));323 $this->assertCount( $total_posts - 1, $data ); 324 324 $this->assertNotEquals( self::$editor_id, $data[0]['author'] ); 325 325 $this->assertNotEquals( self::$editor_id, $data[1]['author'] ); … … 352 352 $response = rest_get_server()->dispatch( $request ); 353 353 $data = $response->get_data(); 354 $this->assert Same( 2, count( $data ));354 $this->assertCount( 2, $data ); 355 355 $this->assertSame( $id2, $data[0]['id'] ); 356 356 $this->assertPostsOrderedBy( '{posts}.post_date DESC' ); … … 360 360 $response = rest_get_server()->dispatch( $request ); 361 361 $data = $response->get_data(); 362 $this->assert Same( 2, count( $data ));362 $this->assertCount( 2, $data ); 363 363 $this->assertSame( $id1, $data[0]['id'] ); 364 364 $this->assertPostsOrderedBy( "FIELD({posts}.ID,$id1,$id2)" ); … … 510 510 $request->set_param( 'per_page', self::$per_page ); 511 511 $response = rest_get_server()->dispatch( $request ); 512 $this->assert Same( $total_posts, count( $response->get_data()) );512 $this->assertCount( $total_posts, $response->get_data() ); 513 513 514 514 $request = new WP_REST_Request( 'GET', '/wp/v2/posts' ); … … 516 516 $response = rest_get_server()->dispatch( $request ); 517 517 $data = $response->get_data(); 518 $this->assert Same( 1, count( $data ));518 $this->assertCount( 1, $data ); 519 519 $this->assertSame( 'Search Result', $data[0]['title']['rendered'] ); 520 520 } … … 539 539 $this->assertSame( 200, $response->get_status() ); 540 540 $data = $response->get_data(); 541 $this->assert Same( 1, count( $data ));541 $this->assertCount( 1, $data ); 542 542 $this->assertSame( 'Apple', $data[0]['title']['rendered'] ); 543 543 } … … 568 568 $this->assertSame( 200, $response->get_status() ); 569 569 $data = $response->get_data(); 570 $this->assert Same( 2, count( $data ));570 $this->assertCount( 2, $data ); 571 571 $titles = array( 572 572 $data[0]['title']['rendered'], … … 602 602 $this->assertSame( 200, $response->get_status() ); 603 603 $data = $response->get_data(); 604 $this->assert Same( 2, count( $data ));604 $this->assertCount( 2, $data ); 605 605 $titles = array( 606 606 $data[0]['title']['rendered'], … … 621 621 $response = rest_get_server()->dispatch( $request ); 622 622 $this->assertSame( 200, $response->get_status() ); 623 $this->assert Same( self::$total_posts, count( $response->get_data()) );623 $this->assertCount( self::$total_posts, $response->get_data() ); 624 624 625 625 $request = new WP_REST_Request( 'GET', '/wp/v2/posts' ); … … 634 634 $response = rest_get_server()->dispatch( $request ); 635 635 $this->assertSame( 200, $response->get_status() ); 636 $this->assert Same( 1, count( $response->get_data()) );636 $this->assertCount( 1, $response->get_data() ); 637 637 } 638 638 … … 651 651 $this->assertSame( 200, $response->get_status() ); 652 652 $data = $response->get_data(); 653 $this->assert Same( 2, count( $data ));653 $this->assertCount( 2, $data ); 654 654 $statuses = array( 655 655 $data[0]['status'], … … 674 674 $this->assertSame( 200, $response->get_status() ); 675 675 $data = $response->get_data(); 676 $this->assert Same( 2, count( $data ));676 $this->assertCount( 2, $data ); 677 677 $statuses = array( 678 678 $data[0]['status'], … … 4168 4168 $data = $response->get_data(); 4169 4169 $properties = $data['schema']['properties']; 4170 $this->assert Same( 26, count( $properties ));4170 $this->assertCount( 26, $properties ); 4171 4171 $this->assertArrayHasKey( 'author', $properties ); 4172 4172 $this->assertArrayHasKey( 'comment_status', $properties ); -
trunk/tests/phpunit/tests/rest-api/rest-revisions-controller.php
r50463 r51367 329 329 $data = $response->get_data(); 330 330 $properties = $data['schema']['properties']; 331 $this->assert Same( 12, count( $properties ));331 $this->assertCount( 12, $properties ); 332 332 $this->assertArrayHasKey( 'author', $properties ); 333 333 $this->assertArrayHasKey( 'content', $properties ); -
trunk/tests/phpunit/tests/rest-api/rest-search-controller.php
r49603 r51367 176 176 177 177 $this->assertSame( 200, $response->get_status() ); 178 $this->assert Same( 3, count( $response->get_data()) );178 $this->assertCount( 3, $response->get_data() ); 179 179 } 180 180 -
trunk/tests/phpunit/tests/rest-api/rest-tags-controller.php
r50463 r51367 201 201 $response = rest_get_server()->dispatch( $request ); 202 202 $data = $response->get_data(); 203 $this->assert Same( 2, count( $data ));203 $this->assertCount( 2, $data ); 204 204 $this->assertSame( 'Season 5', $data[0]['name'] ); 205 205 $this->assertSame( 'The Be Sharps', $data[1]['name'] ); … … 221 221 $response = rest_get_server()->dispatch( $request ); 222 222 $data = $response->get_data(); 223 $this->assert Same( 2, count( $data ));223 $this->assertCount( 2, $data ); 224 224 $this->assertSame( $id1, $data[0]['id'] ); 225 225 … … 228 228 $response = rest_get_server()->dispatch( $request ); 229 229 $data = $response->get_data(); 230 $this->assert Same( 2, count( $data ));230 $this->assertCount( 2, $data ); 231 231 $this->assertSame( $id2, $data[0]['id'] ); 232 232 … … 303 303 $this->assertSame( 200, $response->get_status() ); 304 304 $data = $response->get_data(); 305 $this->assert Same( 1, count( $data ));305 $this->assertCount( 1, $data ); 306 306 $this->assertSame( 'Zucchini', $data[0]['name'] ); 307 307 … … 313 313 $this->assertSame( 200, $response->get_status() ); 314 314 $data = $response->get_data(); 315 $this->assert Same( 2, count( $data ));315 $this->assertCount( 2, $data ); 316 316 $this->assertSame( 'Apple', $data[0]['name'] ); 317 317 … … 388 388 389 389 $data = $response->get_data(); 390 $this->assert Same( 2, count( $data ));390 $this->assertCount( 2, $data ); 391 391 $this->assertSame( 'DC', $data[0]['name'] ); 392 392 … … 475 475 476 476 $data = $response->get_data(); 477 $this->assert Same( 2, count( $data ));477 $this->assertCount( 2, $data ); 478 478 $this->assertSame( 'Cape', $data[0]['name'] ); 479 479 } … … 492 492 $this->assertSame( 200, $response->get_status() ); 493 493 $data = $response->get_data(); 494 $this->assert Same( 1, count( $data ));494 $this->assertCount( 1, $data ); 495 495 $this->assertSame( 'Apple', $data[0]['name'] ); 496 496 … … 500 500 $this->assertSame( 200, $response->get_status() ); 501 501 $data = $response->get_data(); 502 $this->assert Same( 0, count( $data ));502 $this->assertCount( 0, $data ); 503 503 } 504 504 … … 512 512 $this->assertSame( 200, $response->get_status() ); 513 513 $data = $response->get_data(); 514 $this->assert Same( 1, count( $data ));514 $this->assertCount( 1, $data ); 515 515 $this->assertSame( 'Apple', $data[0]['name'] ); 516 516 } … … 1225 1225 $data = $response->get_data(); 1226 1226 $properties = $data['schema']['properties']; 1227 $this->assert Same( 8, count( $properties ));1227 $this->assertCount( 8, $properties ); 1228 1228 $this->assertArrayHasKey( 'id', $properties ); 1229 1229 $this->assertArrayHasKey( 'count', $properties ); -
trunk/tests/phpunit/tests/rest-api/rest-taxonomies-controller.php
r50450 r51367 212 212 $this->assertArrayHasKey( 1, $types ); 213 213 $this->assertSame( 'attachment', $types[1] ); 214 $this->assert Same( 2, count( $types ));214 $this->assertCount( 2, $types ); 215 215 } 216 216 … … 220 220 $data = $response->get_data(); 221 221 $properties = $data['schema']['properties']; 222 $this->assert Same( 10, count( $properties ));222 $this->assertCount( 10, $properties ); 223 223 $this->assertArrayHasKey( 'capabilities', $properties ); 224 224 $this->assertArrayHasKey( 'description', $properties ); -
trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php
r51137 r51367 343 343 $data = $response->get_data(); 344 344 $properties = $data['schema']['properties']; 345 $this->assert Same( 15, count( $properties ));345 $this->assertCount( 15, $properties ); 346 346 347 347 $this->assertArrayHasKey( 'author', $properties ); -
trunk/tests/phpunit/tests/rest-api/rest-users-controller.php
r51331 r51367 388 388 $request = new WP_REST_Request( 'GET', '/wp/v2/users' ); 389 389 $response = rest_get_server()->dispatch( $request ); 390 $this->assert Same( 10, count( $response->get_data()) );390 $this->assertCount( 10, $response->get_data() ); 391 391 392 392 $request = new WP_REST_Request( 'GET', '/wp/v2/users' ); 393 393 $request->set_param( 'per_page', 5 ); 394 394 $response = rest_get_server()->dispatch( $request ); 395 $this->assert Same( 5, count( $response->get_data()) );395 $this->assertCount( 5, $response->get_data() ); 396 396 } 397 397 … … 403 403 $request->set_param( 'page', 2 ); 404 404 $response = rest_get_server()->dispatch( $request ); 405 $this->assert Same( 5, count( $response->get_data()) );405 $this->assertCount( 5, $response->get_data() ); 406 406 $prev_link = add_query_arg( 407 407 array( … … 599 599 $response = rest_get_server()->dispatch( $request ); 600 600 $data = $response->get_data(); 601 $this->assert Same( 2, count( $data ));601 $this->assertCount( 2, $data ); 602 602 $this->assertSame( $id1, $data[0]['id'] ); 603 603 … … 606 606 $response = rest_get_server()->dispatch( $request ); 607 607 $data = $response->get_data(); 608 $this->assert Same( 2, count( $data ));608 $this->assertCount( 2, $data ); 609 609 $this->assertSame( $id2, $data[0]['id'] ); 610 610 … … 619 619 $response = rest_get_server()->dispatch( $request ); 620 620 $data = $response->get_data(); 621 $this->assert Same( 0, count( $data ));621 $this->assertCount( 0, $data ); 622 622 623 623 } … … 656 656 $request->set_param( 'search', 'yololololo' ); 657 657 $response = rest_get_server()->dispatch( $request ); 658 $this->assert Same( 0, count( $response->get_data()) );658 $this->assertCount( 0, $response->get_data() ); 659 659 660 660 $yolo_id = $this->factory->user->create( array( 'display_name' => 'yololololo' ) ); … … 663 663 $request->set_param( 'search', 'yololololo' ); 664 664 $response = rest_get_server()->dispatch( $request ); 665 $this->assert Same( 1, count( $response->get_data()) );665 $this->assertCount( 1, $response->get_data() ); 666 666 // Default to wildcard search. 667 667 $adam_id = $this->factory->user->create( … … 676 676 $response = rest_get_server()->dispatch( $request ); 677 677 $data = $response->get_data(); 678 $this->assert Same( 1, count( $data ));678 $this->assertCount( 1, $data ); 679 679 $this->assertSame( $adam_id, $data[0]['id'] ); 680 680 } … … 700 700 $response = rest_get_server()->dispatch( $request ); 701 701 $data = $response->get_data(); 702 $this->assert Same( 1, count( $data ));702 $this->assertCount( 1, $data ); 703 703 $this->assertSame( $id2, $data[0]['id'] ); 704 704 } … … 813 813 $response = rest_get_server()->dispatch( $request ); 814 814 $data = $response->get_data(); 815 $this->assert Same( 3, count( $data ));815 $this->assertCount( 3, $data ); 816 816 $this->assertSame( $tango, $data[1]['id'] ); 817 817 $this->assertSame( $yolo, $data[2]['id'] ); … … 820 820 $response = rest_get_server()->dispatch( $request ); 821 821 $data = $response->get_data(); 822 $this->assert Same( 1, count( $data ));822 $this->assertCount( 1, $data ); 823 823 $this->assertSame( $yolo, $data[0]['id'] ); 824 824 … … 850 850 $response = rest_get_server()->dispatch( $request ); 851 851 $data = $response->get_data(); 852 $this->assert Same( 1, count( $data ));852 $this->assertCount( 1, $data ); 853 853 $this->assertSame( $lolz, $data[0]['id'] ); 854 854 … … 857 857 $response = rest_get_server()->dispatch( $request ); 858 858 $data = $response->get_data(); 859 $this->assert Same( 0, count( $data ));859 $this->assertCount( 0, $data ); 860 860 $this->assertSame( array(), $data ); 861 861 } … … 2621 2621 $properties = $data['schema']['properties']; 2622 2622 2623 $this->assert Same( 19, count( $properties ));2623 $this->assertCount( 19, $properties ); 2624 2624 $this->assertArrayHasKey( 'avatar_urls', $properties ); 2625 2625 $this->assertArrayHasKey( 'capabilities', $properties ); -
trunk/tests/phpunit/tests/rest-api/rest-widgets-controller.php
r51277 r51367 1451 1451 $properties = $data['schema']['properties']; 1452 1452 1453 $this->assert Same( 7, count( $properties ));1453 $this->assertCount( 7, $properties ); 1454 1454 $this->assertArrayHasKey( 'id', $properties ); 1455 1455 $this->assertArrayHasKey( 'id_base', $properties ); -
trunk/tests/phpunit/tests/taxonomy.php
r51337 r51367 863 863 $this->assertNotContains( '%foo%', $wp_rewrite->rewritecode ); 864 864 $this->assertNotContains( 'bar=', $wp_rewrite->queryreplace ); 865 $this->assert Same( --$count_before, count( $wp_rewrite->rewritereplace )); // Array was reduced by one value.865 $this->assertCount( --$count_before, $wp_rewrite->rewritereplace ); // Array was reduced by one value. 866 866 } 867 867 … … 892 892 893 893 $this->assertArrayHasKey( 'wp_ajax_add-foo', $wp_filter ); 894 $this->assert Same( 1, count( $wp_filter['wp_ajax_add-foo']->callbacks ));894 $this->assertCount( 1, $wp_filter['wp_ajax_add-foo']->callbacks ); 895 895 $this->assertTrue( unregister_taxonomy( 'foo' ) ); 896 896 $this->assertArrayNotHasKey( 'wp_ajax_add-foo', $wp_filter ); -
trunk/tests/phpunit/tests/term.php
r51331 r51367 102 102 103 103 $tt = wp_add_object_terms( $posts[0], $tags[1], 'post_tag' ); 104 $this->assert Same( 1, count( $tt ));104 $this->assertCount( 1, $tt ); 105 105 $this->assertSame( array( $tags[1] ), wp_get_object_terms( $posts[0], 'post_tag', array( 'fields' => 'ids' ) ) ); 106 106 107 107 $three_tags = array( $tags[0], $tags[1], $tags[2] ); 108 108 $tt = wp_add_object_terms( $posts[1], $three_tags, 'post_tag' ); 109 $this->assert Same( 3, count( $tt ));109 $this->assertCount( 3, $tt ); 110 110 $this->assertSame( $three_tags, wp_get_object_terms( $posts[1], 'post_tag', array( 'fields' => 'ids' ) ) ); 111 111 … … 114 114 $this->assertInstanceOf( 'WP_Error', wp_remove_object_terms( $posts[0], $tags[1], 'non_existing_taxonomy' ) ); 115 115 $this->assertTrue( wp_remove_object_terms( $posts[1], $three_tags, 'post_tag' ) ); 116 $this->assert Same( 0, count( wp_get_object_terms( $posts[1], 'post_tag' )) );116 $this->assertCount( 0, wp_get_object_terms( $posts[1], 'post_tag' ) ); 117 117 118 118 foreach ( $tags as $term_id ) { … … 178 178 179 179 $this->assertIsArray( $post->post_category ); 180 $this->assert Same( 1, count( $post->post_category ));180 $this->assertCount( 1, $post->post_category ); 181 181 $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] ); 182 182 … … 186 186 187 187 wp_set_post_categories( $post_id, array( $term1['term_id'], $term2['term_id'] ) ); 188 $this->assert Same( 2, count( $post->post_category ));188 $this->assertCount( 2, $post->post_category ); 189 189 $this->assertSame( array( $term2['term_id'], $term1['term_id'] ), $post->post_category ); 190 190 … … 201 201 202 202 wp_set_post_categories( $post_id, array(), true ); 203 $this->assert Same( 1, count( $post->post_category ));203 $this->assertCount( 1, $post->post_category ); 204 204 $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] ); 205 205 206 206 wp_set_post_categories( $post_id, array() ); 207 $this->assert Same( 1, count( $post->post_category ));207 $this->assertCount( 1, $post->post_category ); 208 208 $this->assertEquals( get_option( 'default_category' ), $post->post_category[0] ); 209 209 } -
trunk/tests/phpunit/tests/term/cache.php
r50926 r51367 84 84 85 85 $terms = get_terms( $tax, array( 'hide_empty' => false ) ); 86 $this->assert Same( $i, count( $terms ));86 $this->assertCount( $i, $terms ); 87 87 if ( $i > 1 ) { 88 88 $hierarchy = _get_term_hierarchy( $tax ); -
trunk/tests/phpunit/tests/term/getTerms.php
r51331 r51367 116 116 // last_changed and num_queries should bump. 117 117 $terms = get_terms( 'post_tag', array( 'update_term_meta_cache' => false ) ); 118 $this->assert Same( 3, count( $terms ));118 $this->assertCount( 3, $terms ); 119 119 $time1 = wp_cache_get( 'last_changed', 'terms' ); 120 120 $this->assertNotEmpty( $time1 ); … … 125 125 // Again. last_changed and num_queries should remain the same. 126 126 $terms = get_terms( 'post_tag', array( 'update_term_meta_cache' => false ) ); 127 $this->assert Same( 3, count( $terms ));127 $this->assertCount( 3, $terms ); 128 128 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'terms' ) ); 129 129 $this->assertSame( $num_queries, $wpdb->num_queries ); … … 145 145 // num_queries should bump, last_changed should remain the same. 146 146 $terms = get_terms( 'post_tag', array( 'number' => 2 ) ); 147 $this->assert Same( 2, count( $terms ));147 $this->assertCount( 2, $terms ); 148 148 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'terms' ) ); 149 149 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); … … 153 153 // Again. last_changed and num_queries should remain the same. 154 154 $terms = get_terms( 'post_tag', array( 'number' => 2 ) ); 155 $this->assert Same( 2, count( $terms ));155 $this->assertCount( 2, $terms ); 156 156 $this->assertSame( $time1, wp_cache_get( 'last_changed', 'terms' ) ); 157 157 $this->assertSame( $num_queries, $wpdb->num_queries ); … … 180 180 // last_changed and num_queries should bump after a term is deleted. 181 181 $terms = get_terms( 'post_tag' ); 182 $this->assert Same( 2, count( $terms ));182 $this->assertCount( 2, $terms ); 183 183 $this->assertSame( $time2, wp_cache_get( 'last_changed', 'terms' ) ); 184 184 $this->assertSame( $num_queries + 1, $wpdb->num_queries ); … … 188 188 // Again. last_changed and num_queries should remain the same. 189 189 $terms = get_terms( 'post_tag' ); 190 $this->assert Same( 2, count( $terms ));190 $this->assertCount( 2, $terms ); 191 191 $this->assertSame( $time2, wp_cache_get( 'last_changed', 'terms' ) ); 192 192 $this->assertSame( $num_queries, $wpdb->num_queries ); … … 618 618 ) 619 619 ); 620 $this->assert Same( 2, count( $terms ));620 $this->assertCount( 2, $terms ); 621 621 $this->assertSame( wp_list_pluck( $terms, 'name' ), array( 'Cheese', 'Crackers' ) ); 622 622 } … … 661 661 ) 662 662 ); 663 $this->assert Same( 1, count( $terms ));663 $this->assertCount( 1, $terms ); 664 664 $this->assertSame( array( 'Cheese' ), wp_list_pluck( $terms, 'name' ) ); 665 665 … … 697 697 ) 698 698 ); 699 $this->assert Same( 1, count( $terms ));699 $this->assertCount( 1, $terms ); 700 700 $this->assertSame( array( 'term1' ), wp_list_pluck( $terms, 'name' ) ); 701 701 … … 717 717 ) 718 718 ); 719 $this->assert Same( 1, count( $terms ));719 $this->assertCount( 1, $terms ); 720 720 } 721 721 … … 2309 2309 2310 2310 // Verify that there are no children. 2311 $this->assert Same( 0, count( $terms ));2311 $this->assertCount( 0, $terms ); 2312 2312 } 2313 2313 … … 2375 2375 2376 2376 // Verify that there are no children. 2377 $this->assert Same( 0, count( $terms ));2377 $this->assertCount( 0, $terms ); 2378 2378 } 2379 2379 … … 2488 2488 2489 2489 // 'hierarchical=false' means that descendants are not fetched. 2490 $this->assert Same( 0, count( $terms ));2490 $this->assertCount( 0, $terms ); 2491 2491 } 2492 2492 -
trunk/tests/phpunit/tests/term/getTheTerms.php
r51335 r51367 23 23 // Cache should be empty after a set. 24 24 $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy ); 25 $this->assert Same( 3, count( $tt_1 ));25 $this->assertCount( 3, $tt_1 ); 26 26 $this->assertFalse( wp_cache_get( $post_id, $this->taxonomy . '_relationships' ) ); 27 27 … … 44 44 // Cache should be empty after a set. 45 45 $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this->taxonomy ); 46 $this->assert Same( 2, count( $tt_2 ));46 $this->assertCount( 2, $tt_2 ); 47 47 $this->assertFalse( wp_cache_get( $post_id, $this->taxonomy . '_relationships' ) ); 48 48 } -
trunk/tests/phpunit/tests/term/meta.php
r51331 r51367 456 456 $meta = has_term_meta( $t ); 457 457 458 $this->assert Same( 1, count( $meta ));458 $this->assertCount( 1, $meta ); 459 459 460 460 $expected = array( -
trunk/tests/phpunit/tests/term/query.php
r48939 r51367 289 289 ); 290 290 291 $this->assert Same( 1, count( $query->terms ));291 $this->assertCount( 1, $query->terms ); 292 292 $this->assertSame( $t, reset( $query->terms )->term_id ); 293 293 } … … 313 313 ); 314 314 315 $this->assert Same( 2, count( $query->terms ));315 $this->assertCount( 2, $query->terms ); 316 316 foreach ( $query->terms as $term ) { 317 317 $this->assertSame( $t, $term->term_id ); -
trunk/tests/phpunit/tests/term/taxQuery.php
r48937 r51367 112 112 ); 113 113 114 $this->assert Same( 1, count( $q->queries ));114 $this->assertCount( 1, $q->queries ); 115 115 } 116 116 -
trunk/tests/phpunit/tests/term/wpGetObjectTerms.php
r51331 r51367 21 21 // Set the initial terms. 22 22 $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy ); 23 $this->assert Same( 3, count( $tt_1 ));23 $this->assertCount( 3, $tt_1 ); 24 24 25 25 // Make sure they're correct. -
trunk/tests/phpunit/tests/term/wpSetObjectTerms.php
r51331 r51367 114 114 $tt = wp_set_object_terms( $id, array_values( $term_id ), $this->taxonomy ); 115 115 // Should return three term taxonomy IDs. 116 $this->assert Same( 3, count( $tt ));116 $this->assertCount( 3, $tt ); 117 117 } 118 118 … … 142 142 $tt = wp_set_object_terms( $id, $terms, $this->taxonomy ); 143 143 // Should return three term taxonomy IDs. 144 $this->assert Same( 3, count( $tt ));144 $this->assertCount( 3, $tt ); 145 145 // Remember which term has which term_id. 146 146 for ( $i = 0; $i < 3; $i++ ) { … … 269 269 // Set the initial terms. 270 270 $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy ); 271 $this->assert Same( 3, count( $tt_1 ));271 $this->assertCount( 3, $tt_1 ); 272 272 273 273 // Make sure they're correct. … … 284 284 // Change the terms. 285 285 $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this->taxonomy ); 286 $this->assert Same( 2, count( $tt_2 ));286 $this->assertCount( 2, $tt_2 ); 287 287 288 288 // Make sure they're correct. … … 313 313 // Set the initial terms. 314 314 $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy ); 315 $this->assert Same( 3, count( $tt_1 ));315 $this->assertCount( 3, $tt_1 ); 316 316 317 317 // Make sure they're correct. … … 328 328 // Change the terms. 329 329 $tt_2 = wp_set_object_terms( $post_id, $terms_2, $this->taxonomy ); 330 $this->assert Same( 2, count( $tt_2 ));330 $this->assertCount( 2, $tt_2 ); 331 331 332 332 // Make sure they're correct. -
trunk/tests/phpunit/tests/theme/wpThemeGetAllowedFilters.php
r50968 r51367 22 22 remove_filter( 'network_allowed_themes', array( $this, 'filter_network_allowed_themes' ) ); 23 23 24 $this->assert Same( 2, count( $this->filter_network_allowed_themes_args ));24 $this->assertCount( 2, $this->filter_network_allowed_themes_args ); 25 25 $this->assertSame( $blog_id, $this->filter_network_allowed_themes_args[1] ); 26 26 } -
trunk/tests/phpunit/tests/user.php
r51335 r51367 768 768 $response = wpmu_validate_user_signup( $user_data['user_login'], $user_data['user_email'] ); 769 769 $this->assertInstanceOf( 'WP_Error', $response['errors'] ); 770 $this->assert Same( 0, count( $response['errors']->get_error_codes()) );770 $this->assertCount( 0, $response['errors']->get_error_codes() ); 771 771 } 772 772 … … 1729 1729 1730 1730 // Number of exported users. 1731 $this->assert Same( 1, count( $actual['data'] ));1731 $this->assertCount( 1, $actual['data'] ); 1732 1732 1733 1733 // Number of exported user properties. 1734 $this->assert Same( 11, count( $actual['data'][0]['data'] ));1734 $this->assertCount( 11, $actual['data'][0]['data'] ); 1735 1735 } 1736 1736 … … 1863 1863 1864 1864 // Number of exported users. 1865 $this->assert Same( 1, count( $actual['data'] ));1865 $this->assertCount( 1, $actual['data'] ); 1866 1866 1867 1867 // Number of exported user properties (the 11 core properties, 1868 1868 // plus 1 additional from the filter). 1869 $this->assert Same( 12, count( $actual['data'][0]['data'] ));1869 $this->assertCount( 12, $actual['data'][0]['data'] ); 1870 1870 1871 1871 // Check that the item added by the filter was retained. … … 1895 1895 1896 1896 // Number of exported users. 1897 $this->assert Same( 1, count( $actual['data'] ));1897 $this->assertCount( 1, $actual['data'] ); 1898 1898 1899 1899 // Number of exported user properties 1900 1900 // (the 11 core properties, plus 1 additional from the filter). 1901 $this->assert Same( 12, count( $actual['data'][0]['data'] ));1901 $this->assertCount( 12, $actual['data'][0]['data'] ); 1902 1902 1903 1903 // Check that the duplicate 'name' => 'User ID' was stripped. -
trunk/tests/phpunit/tests/user/query.php
r51196 r51367 138 138 139 139 // +1 for the default user created during installation. 140 $this->assert Same( 13, count( $users ));140 $this->assertCount( 13, $users ); 141 141 foreach ( $users as $user ) { 142 142 $this->assertInstanceOf( 'WP_User', $user ); … … 150 150 ); 151 151 $users = $users->get_results(); 152 $this->assert Same( 13, count( $users ));152 $this->assertCount( 13, $users ); 153 153 foreach ( $users as $user ) { 154 154 $this->assertInstanceOf( 'WP_User', $user ); … … 503 503 $users = new WP_User_Query( array( 'blog_id' => get_current_blog_id() ) ); 504 504 $users = $users->get_results(); 505 $this->assert Same( 13, count( $users ));505 $this->assertCount( 13, $users ); 506 506 507 507 $users = new WP_User_Query( … … 512 512 ); 513 513 $users = $users->get_results(); 514 $this->assert Same( 10, count( $users ));514 $this->assertCount( 10, $users ); 515 515 516 516 $users = new WP_User_Query( … … 521 521 ); 522 522 $users = $users->get_results(); 523 $this->assert Same( 2, count( $users ));523 $this->assertCount( 2, $users ); 524 524 525 525 $users = new WP_User_Query( … … 530 530 ); 531 531 $users = $users->get_results(); 532 $this->assert Same( 13, count( $users ));532 $this->assertCount( 13, $users ); 533 533 } 534 534 … … 1315 1315 $users = $wp_user_search->get_results(); 1316 1316 1317 $this->assert Same( 2, count( $users ));1317 $this->assertCount( 2, $users ); 1318 1318 } 1319 1319 … … 1324 1324 $wp_user_search = new WP_User_Query( array( 'role__in' => array( 'subscriber', 'editor' ) ) ); 1325 1325 $users = $wp_user_search->get_results(); 1326 $this->assert Same( 5, count( $users ));1326 $this->assertCount( 5, $users ); 1327 1327 } 1328 1328 … … 1337 1337 ); 1338 1338 1339 $this->assert Same( 2, count( $users ));1339 $this->assertCount( 2, $users ); 1340 1340 } 1341 1341 … … 1373 1373 ); 1374 1374 1375 $this->assert Same( 2, count( $users ));1375 $this->assertCount( 2, $users ); 1376 1376 } 1377 1377 … … 1393 1393 $users = $users->get_results(); 1394 1394 1395 $this->assert Same( 2, count( $users ));1395 $this->assertCount( 2, $users ); 1396 1396 1397 1397 foreach ( $users as $user ) { … … 1408 1408 1409 1409 // +1 for the default user created during installation. 1410 $this->assert Same( 8, count( $users ));1410 $this->assertCount( 8, $users ); 1411 1411 foreach ( $users as $user ) { 1412 1412 $this->assertInstanceOf( 'WP_User', $user ); … … 1437 1437 ); 1438 1438 1439 $this->assert Same( 2, count( $users ));1439 $this->assertCount( 2, $users ); 1440 1440 } 1441 1441 … … 1483 1483 1484 1484 // Check results. 1485 $this->assert Same( 1, count( $users ));1485 $this->assertCount( 1, $users ); 1486 1486 $this->assertSame( self::$editor_ids[0], (int) $users[0]->ID ); 1487 1487 } … … 1498 1498 1499 1499 // +1 for the default user created during installation. 1500 $this->assert Same( 11, count( $users ));1500 $this->assertCount( 11, $users ); 1501 1501 1502 1502 $users = get_users( … … 1507 1507 1508 1508 // +1 for the default user created during installation. 1509 $this->assert Same( 10, count( $users ));1509 $this->assertCount( 10, $users ); 1510 1510 } 1511 1511 … … 1525 1525 ); 1526 1526 1527 $this->assert Same( 5, count( $users ));1527 $this->assertCount( 5, $users ); 1528 1528 1529 1529 $users = get_users( … … 1534 1534 ); 1535 1535 1536 $this->assert Same( 3, count( $users ));1536 $this->assertCount( 3, $users ); 1537 1537 } 1538 1538 … … 1551 1551 ); 1552 1552 1553 $this->assert Same( 1, count( $users ));1553 $this->assertCount( 1, $users ); 1554 1554 } 1555 1555 … … 1569 1569 1570 1570 // +1 for the default user created during installation. 1571 $this->assert Same( 12, count( $users ));1571 $this->assertCount( 12, $users ); 1572 1572 1573 1573 $users = get_users( … … 1578 1578 1579 1579 // +1 for the default user created during installation. 1580 $this->assert Same( 10, count( $users ));1580 $this->assertCount( 10, $users ); 1581 1581 } 1582 1582 -
trunk/tests/phpunit/tests/widgets.php
r51331 r51367 157 157 } 158 158 159 $this->assert Same( $num, count( $result ));159 $this->assertCount( $num, $result ); 160 160 161 161 } -
trunk/tests/phpunit/tests/wp.php
r45607 r51367 22 22 $this->wp->add_query_var( 'test' ); 23 23 24 $this->assert Same( $public_qv_count + 2, count( $this->wp->public_query_vars ));24 $this->assertCount( $public_qv_count + 2, $this->wp->public_query_vars ); 25 25 $this->assertTrue( in_array( 'test', $this->wp->public_query_vars, true ) ); 26 26 $this->assertTrue( in_array( 'test2', $this->wp->public_query_vars, true ) ); … … 34 34 $this->wp->remove_query_var( 'test' ); 35 35 36 $this->assert Same( $public_qv_count, count( $this->wp->public_query_vars ));36 $this->assertCount( $public_qv_count, $this->wp->public_query_vars ); 37 37 } 38 38 } -
trunk/tests/phpunit/tests/xmlrpc/mt/getRecentPostTitles.php
r48937 r51367 27 27 $result = $this->myxmlrpcserver->mt_getRecentPostTitles( array( 1, 'author', 'author' ) ); 28 28 $this->assertNotIXRError( $result ); 29 $this->assert Same( 0, count( $result ));29 $this->assertCount( 0, $result ); 30 30 } 31 31 -
trunk/tests/phpunit/tests/xmlrpc/mw/getRecentPosts.php
r51331 r51367 45 45 $result = $this->myxmlrpcserver->mw_getRecentPosts( array( 1, 'author', 'author' ) ); 46 46 $this->assertNotIXRError( $result ); 47 $this->assert Same( 0, count( $result ));47 $this->assertCount( 0, $result ); 48 48 } 49 49 -
trunk/tests/phpunit/tests/xmlrpc/wp/editPost.php
r51331 r51367 443 443 444 444 // Verify that there is only a single value in the array and that a duplicate is not present. 445 $this->assert Same( 1, count( get_post_meta( $post_id, 'enclosure' )) );445 $this->assertCount( 1, get_post_meta( $post_id, 'enclosure' ) ); 446 446 447 447 // For good measure, check that the expected value is in the array. … … 452 452 453 453 // Having added the new enclosure, 2 values are expected in the array. 454 $this->assert Same( 2, count( get_post_meta( $post_id, 'enclosure' )) );454 $this->assertCount( 2, get_post_meta( $post_id, 'enclosure' ) ); 455 455 456 456 // Check that the new enclosure is in the enclosure meta. -
trunk/tests/phpunit/tests/xmlrpc/wp/getPost.php
r51331 r51367 86 86 87 87 // When no fields are requested, only the IDs should be returned. 88 $this->assert Same( 1, count( $result ));88 $this->assertCount( 1, $result ); 89 89 $this->assertSame( array( 'post_id' ), array_keys( $result ) ); 90 90 } -
trunk/tests/phpunit/tests/xmlrpc/wp/getPostTypes.php
r51331 r51367 17 17 $this->assertNotIXRError( $result ); 18 18 $this->assertIsArray( $result ); 19 $this->assert Same( 0, count( $result ));19 $this->assertCount( 0, $result ); 20 20 } 21 21 -
trunk/tests/phpunit/tests/xmlrpc/wp/getPosts.php
r49108 r51367 72 72 $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) ); 73 73 $this->assertNotIXRError( $results ); 74 $this->assert Same( $num_posts, count( $results ));74 $this->assertCount( $num_posts, $results ); 75 75 76 76 // Page through results. … … 84 84 } while ( count( $presults ) > 0 ); 85 85 // Verify that $post_ids matches $posts_found. 86 $this->assert Same( 0, count( array_diff( $post_ids, $posts_found )) );86 $this->assertCount( 0, array_diff( $post_ids, $posts_found ) ); 87 87 88 88 // Add comments to some of the posts. … … 118 118 $results3 = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter3 ) ); 119 119 $this->assertNotIXRError( $results3 ); 120 $this->assert Same( 1, count( $results3 ));120 $this->assertCount( 1, $results3 ); 121 121 $this->assertEquals( $post->ID, $results3[0]['post_id'] ); 122 122 … … 160 160 $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) ); 161 161 $this->assertNotIXRError( $results ); 162 $this->assert Same( 0, count( $results ));162 $this->assertCount( 0, $results ); 163 163 164 164 // Search for one of them. … … 166 166 $results = $this->myxmlrpcserver->wp_getPosts( array( 1, 'editor', 'editor', $filter ) ); 167 167 $this->assertNotIXRError( $results ); 168 $this->assert Same( 1, count( $results ));168 $this->assertCount( 1, $results ); 169 169 } 170 170 -
trunk/tests/phpunit/tests/xmlrpc/wp/getTerms.php
r51331 r51367 78 78 $this->assertNotIXRError( $results ); 79 79 80 $this->assert Same( $num_terms, count( $results ));80 $this->assertCount( $num_terms, $results ); 81 81 foreach ( $results as $term ) { 82 82 $this->assertSame( $tax_name, $term['taxonomy'] ); … … 87 87 $results2 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) ); 88 88 $this->assertNotIXRError( $results ); 89 $this->assert Same( 5, count( $results2 ));89 $this->assertCount( 5, $results2 ); 90 90 $this->assertSame( $results[1]['term_id'], $results2[1]['term_id'] ); // Check one of the terms. 91 91 … … 93 93 $results3 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) ); 94 94 $this->assertNotIXRError( $results3 ); 95 $this->assert Same( $num_terms - 10, count( $results3 ));95 $this->assertCount( $num_terms - 10, $results3 ); 96 96 $this->assertSame( $results[11]['term_id'], $results3[1]['term_id'] ); 97 97 … … 100 100 $results4 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', $tax_name, $filter ) ); 101 101 $this->assertNotIXRError( $results4 ); 102 $this->assert Same( 0, count( $results4 ));102 $this->assertCount( 0, $results4 ); 103 103 104 104 unset( $GLOBALS['wp_taxonomies'][ $tax_name ] ); … … 120 120 $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) ); 121 121 $this->assertNotIXRError( $results ); 122 $this->assertNot Equals( 0, count( $results ));122 $this->assertNotCount( 0, $results ); 123 123 124 124 foreach ( $results as $term ) { … … 141 141 $results = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) ); 142 142 $this->assertNotIXRError( $results ); 143 $this->assert Same( 1, count( $results ));143 $this->assertCount( 1, $results ); 144 144 $this->assertSame( $name, $results[0]['name'] ); 145 145 $this->assertEquals( $name_id, $results[0]['term_id'] ); … … 149 149 $results2 = $this->myxmlrpcserver->wp_getTerms( array( 1, 'editor', 'editor', 'category', $filter ) ); 150 150 $this->assertNotIXRError( $results2 ); 151 $this->assert Same( 1, count( $results2 ));151 $this->assertCount( 1, $results2 ); 152 152 $this->assertSame( $name, $results2[0]['name'] ); 153 153 $this->assertEquals( $name_id, $results2[0]['term_id'] ); -
trunk/tests/phpunit/tests/xmlrpc/wp/getUsers.php
r51331 r51367 103 103 104 104 // Verify that $user_ids matches $users_found. 105 $this->assert Same( 0, count( array_diff( $user_ids, $users_found )) );105 $this->assertCount( 0, array_diff( $user_ids, $users_found ) ); 106 106 } 107 107
Note: See TracChangeset
for help on using the changeset viewer.