Changeset 54402
- Timestamp:
- 10/07/2022 01:02:07 AM (2 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesUser.php
r49109 r54402 18 18 if ( $error_code ) { 19 19 $this->assertWPError( $error ); 20 $this->assert Equals( $error_code, $error->get_error_code() );20 $this->assertSame( $error_code, $error->get_error_code() ); 21 21 } else { 22 22 $this->assertNotWPError( $error ); -
trunk/tests/phpunit/tests/ajax/CustomizeManager.php
r54088 r54402 133 133 } 134 134 $this->assertNotEmpty( $e ); 135 $this->assert Equals( -1, $e->getMessage() );135 $this->assertSame( '-1', $e->getMessage() ); 136 136 137 137 // Not called setup_theme. -
trunk/tests/phpunit/tests/block-template-utils.php
r54198 r54402 209 209 */ 210 210 function test_remove_theme_attribute_in_block_template_content( $template_content, $expected ) { 211 $this->assert Equals( $expected, _remove_theme_attribute_in_block_template_content( $template_content ) );211 $this->assertSame( $expected, _remove_theme_attribute_in_block_template_content( $template_content ) ); 212 212 } 213 213 -
trunk/tests/phpunit/tests/blocks/wpBlockType.php
r53268 r54402 241 241 $prepared_attributes = $block_type->prepare_attributes_for_render( $attributes ); 242 242 243 $this->assert Equals(243 $this->assertSameSetsWithIndex( 244 244 array( 245 245 'correct' => 'include', -
trunk/tests/phpunit/tests/comment/getCommentsPagesCount.php
r53863 r54402 175 175 $wp_query->max_num_comment_pages = 7; 176 176 177 $this->assert Equals( 7, get_comment_pages_count() );178 $this->assert Equals( 7, get_comment_pages_count( null, null, null ) );179 $this->assert Equals( 0, get_comment_pages_count( array(), null, null ) );177 $this->assertSame( 7, get_comment_pages_count() ); 178 $this->assertSame( 7, get_comment_pages_count( null, null, null ) ); 179 $this->assertSame( 0, get_comment_pages_count( array(), null, null ) ); 180 180 181 181 $wp_query->max_num_comment_pages = $org_max_num_comment_pages; -
trunk/tests/phpunit/tests/comment/query.php
r53942 r54402 4022 4022 ); 4023 4023 4024 $this->assert Equals( 3, $q->found_comments );4024 $this->assertSame( 3, $q->found_comments ); 4025 4025 $this->assertEquals( 2, $q->max_num_pages ); 4026 4026 } -
trunk/tests/phpunit/tests/customize/manager.php
r54088 r54402 2534 2534 $this->assertSame( $default_value, $setting->post_value( $default_value ) ); 2535 2535 2536 $post_value = '42';2537 $this->manager->set_post_value( 'numeric', $post_value );2538 $this->assert Equals( $post_value, $this->manager->post_value( $setting, $default_value ) );2539 $this->assert Equals( $post_value, $setting->post_value( $default_value ) );2536 $post_value = 42; 2537 $this->manager->set_post_value( 'numeric', (string) $post_value ); 2538 $this->assertSame( $post_value, $this->manager->post_value( $setting, $default_value ) ); 2539 $this->assertSame( $post_value, $setting->post_value( $default_value ) ); 2540 2540 } 2541 2541 -
trunk/tests/phpunit/tests/customize/selective-refresh-ajax.php
r52010 r54402 189 189 ); 190 190 191 $count_customize_render_partials_before = has_action( 'customize_render_partials_before' );192 $count_customize_render_partials_after = has_action( 'customize_render_partials_after' );193 191 ob_start(); 194 192 try { … … 201 199 $this->assertSame( '', $e->getMessage() ); 202 200 } 203 $this->assert Equals( $count_customize_render_partials_before + 1,has_action( 'customize_render_partials_before' ) );204 $this->assert Equals( $count_customize_render_partials_after + 1,has_action( 'customize_render_partials_after' ) );201 $this->assertTrue( has_action( 'customize_render_partials_before' ) ); 202 $this->assertTrue( has_action( 'customize_render_partials_after' ) ); 205 203 $output = json_decode( ob_get_clean(), true ); 206 204 $this->assertSame( array( false ), $output['data']['contents']['foo'] ); … … 327 325 ); 328 326 329 $count_customize_render_partials_before = has_action( 'customize_render_partials_before' );330 $count_customize_render_partials_after = has_action( 'customize_render_partials_after' );331 327 ob_start(); 332 328 try { … … 339 335 $this->assertSame( '', $e->getMessage() ); 340 336 } 341 $this->assert Equals( $count_customize_render_partials_before + 1,has_action( 'customize_render_partials_before' ) );342 $this->assert Equals( $count_customize_render_partials_after + 1,has_action( 'customize_render_partials_after' ) );337 $this->assertTrue( has_action( 'customize_render_partials_before' ) ); 338 $this->assertTrue( has_action( 'customize_render_partials_after' ) ); 343 339 $output = json_decode( ob_get_clean(), true ); 344 340 $this->assertSame( array( get_bloginfo( 'name', 'display' ) ), $output['data']['contents']['test_blogname'] ); … … 436 432 ); 437 433 438 $count_customize_render_partials_before = has_action( 'customize_render_partials_before' );439 $count_customize_render_partials_after = has_action( 'customize_render_partials_after' );440 434 ob_start(); 441 435 try { … … 448 442 $this->assertSame( '', $e->getMessage() ); 449 443 } 450 $this->assert Equals( $count_customize_render_partials_before + 1,has_action( 'customize_render_partials_before' ) );451 $this->assert Equals( $count_customize_render_partials_after + 1,has_action( 'customize_render_partials_after' ) );444 $this->assertTrue( has_action( 'customize_render_partials_before' ) ); 445 $this->assertTrue( has_action( 'customize_render_partials_after' ) ); 452 446 $output = json_decode( ob_get_clean(), true ); 453 447 $this->assertSame( array( get_bloginfo( 'name', 'display' ) ), $output['data']['contents']['test_dynamic_blogname'] ); … … 488 482 ); 489 483 490 $count_customize_render_partials_before = has_action( 'customize_render_partials_before' );491 $count_customize_render_partials_after = has_action( 'customize_render_partials_after' );492 484 ob_start(); 493 485 try { … … 500 492 $this->assertSame( '', $e->getMessage() ); 501 493 } 502 $this->assert Equals( $count_customize_render_partials_before + 1,has_action( 'customize_render_partials_before' ) );503 $this->assert Equals( $count_customize_render_partials_after + 1,has_action( 'customize_render_partials_after' ) );494 $this->assertTrue( has_action( 'customize_render_partials_before' ) ); 495 $this->assertTrue( has_action( 'customize_render_partials_after' ) ); 504 496 $output = json_decode( ob_get_clean(), true ); 505 497 $this->assertSame( array( get_bloginfo( 'name', 'display' ) ), $output['data']['contents']['test_blogname'] ); -
trunk/tests/phpunit/tests/formatting/mapDeep.php
r53562 r54402 50 50 51 51 public function test_map_deep_should_map_each_object_element_of_an_array() { 52 $this->assertEqual s(52 $this->assertEqualSets( 53 53 array( 54 54 'var0' => 'ababa', -
trunk/tests/phpunit/tests/functions.php
r53934 r54402 2057 2057 */ 2058 2058 public function test_wp_get_default_extension_for_mime_type() { 2059 $this->assert Equals( 'jpg', wp_get_default_extension_for_mime_type( 'image/jpeg' ), 'jpg not returned as default extension for "image/jpeg"' );2059 $this->assertSame( 'jpg', wp_get_default_extension_for_mime_type( 'image/jpeg' ), 'jpg not returned as default extension for "image/jpeg"' ); 2060 2060 $this->assertNotEquals( 'jpeg', wp_get_default_extension_for_mime_type( 'image/jpeg' ), 'jpeg should not be returned as default extension for "image/jpeg"' ); 2061 $this->assert Equals( 'png', wp_get_default_extension_for_mime_type( 'image/png' ), 'png not returned as default extension for "image/png"' );2061 $this->assertSame( 'png', wp_get_default_extension_for_mime_type( 'image/png' ), 'png not returned as default extension for "image/png"' ); 2062 2062 $this->assertFalse( wp_get_default_extension_for_mime_type( 'wibble/wobble' ), 'false not returned for unrecognized mime type' ); 2063 2063 $this->assertFalse( wp_get_default_extension_for_mime_type( '' ), 'false not returned when empty string as mime type supplied' ); … … 2073 2073 function test_wp_filesize_with_nonexistent_file() { 2074 2074 $file = 'nonexistent/file.jpg'; 2075 $this->assert Equals( 0, wp_filesize( $file ) );2075 $this->assertSame( 0, wp_filesize( $file ) ); 2076 2076 } 2077 2077 … … 2083 2083 $file = DIR_TESTDATA . '/images/test-image-upside-down.jpg'; 2084 2084 2085 $this->assert Equals( filesize( $file ), wp_filesize( $file ) );2085 $this->assertSame( filesize( $file ), wp_filesize( $file ) ); 2086 2086 2087 2087 $filter = function() { … … 2091 2091 add_filter( 'wp_filesize', $filter ); 2092 2092 2093 $this->assert Equals( 999, wp_filesize( $file ) );2093 $this->assertSame( 999, wp_filesize( $file ) ); 2094 2094 2095 2095 $pre_filter = function() { … … 2099 2099 add_filter( 'pre_wp_filesize', $pre_filter ); 2100 2100 2101 $this->assert Equals( 111, wp_filesize( $file ) );2101 $this->assertSame( 111, wp_filesize( $file ) ); 2102 2102 } 2103 2103 … … 2185 2185 'version' => 1, 2186 2186 ); 2187 $this->assert Equals( $theme_json, $expected_theme_json );2187 $this->assertSameSetsWithIndex( $theme_json, $expected_theme_json ); 2188 2188 } 2189 2189 -
trunk/tests/phpunit/tests/import/import.php
r53864 r54402 63 63 64 64 // Check that terms were imported correctly. 65 $this->assert Equals( 30, wp_count_terms( array( 'taxonomy' => 'category' ) ) );66 $this->assert Equals( 3, wp_count_terms( array( 'taxonomy' => 'post_tag' ) ) );65 $this->assertSame( '30', wp_count_terms( array( 'taxonomy' => 'category' ) ) ); 66 $this->assertSame( '3', wp_count_terms( array( 'taxonomy' => 'post_tag' ) ) ); 67 67 $foo = get_term_by( 'slug', 'foo', 'category' ); 68 68 $this->assertSame( 0, $foo->parent ); … … 73 73 // Check that posts/pages were imported correctly. 74 74 $post_count = wp_count_posts( 'post' ); 75 $this->assert Equals( 5, $post_count->publish );76 $this->assert Equals( 1, $post_count->private );75 $this->assertSame( '5', $post_count->publish ); 76 $this->assertSame( '1', $post_count->private ); 77 77 $page_count = wp_count_posts( 'page' ); 78 $this->assert Equals( 4, $page_count->publish );79 $this->assert Equals( 1, $page_count->draft );78 $this->assertSame( '4', $page_count->publish ); 79 $this->assertSame( '1', $page_count->draft ); 80 80 $comment_count = wp_count_comments(); 81 81 $this->assertSame( 1, $comment_count->total_comments ); … … 231 231 $this->assertSame( 'author@example.org', $author->user_email ); 232 232 233 $this->assert Equals( 30, wp_count_terms( array( 'taxonomy' => 'category' ) ) );234 $this->assert Equals( 3, wp_count_terms( array( 'taxonomy' => 'post_tag' ) ) );233 $this->assertSame( '30', wp_count_terms( array( 'taxonomy' => 'category' ) ) ); 234 $this->assertSame( '3', wp_count_terms( array( 'taxonomy' => 'post_tag' ) ) ); 235 235 $foo = get_term_by( 'slug', 'foo', 'category' ); 236 236 $this->assertSame( 0, $foo->parent ); … … 240 240 241 241 $post_count = wp_count_posts( 'post' ); 242 $this->assert Equals( 5, $post_count->publish );243 $this->assert Equals( 1, $post_count->private );242 $this->assertSame( '5', $post_count->publish ); 243 $this->assertSame( '1', $post_count->private ); 244 244 $page_count = wp_count_posts( 'page' ); 245 $this->assert Equals( 4, $page_count->publish );246 $this->assert Equals( 1, $page_count->draft );245 $this->assertSame( '4', $page_count->publish ); 246 $this->assertSame( '1', $page_count->draft ); 247 247 $comment_count = wp_count_comments(); 248 248 $this->assertSame( 1, $comment_count->total_comments ); -
trunk/tests/phpunit/tests/import/parser.php
r53864 r54402 75 75 $this->assertIsArray( $result, $message ); 76 76 $this->assertSame( 'http://localhost/', $result['base_url'], $message ); 77 $this->assertEqual s(77 $this->assertEqualSetsWithIndex( 78 78 array( 79 79 'author_id' => 2, … … 87 87 $message 88 88 ); 89 $this->assertEqual s(89 $this->assertEqualSetsWithIndex( 90 90 array( 91 91 'term_id' => 3, … … 98 98 $message 99 99 ); 100 $this->assertEqual s(100 $this->assertEqualSetsWithIndex( 101 101 array( 102 102 'term_id' => 22, … … 108 108 $message 109 109 ); 110 $this->assertEqual s(110 $this->assertEqualSetsWithIndex( 111 111 array( 112 112 'term_id' => 40, … … 124 124 $this->assertCount( 19, $result['posts'][0], $message ); 125 125 $this->assertCount( 18, $result['posts'][1], $message ); 126 $this->assertEqual s(126 $this->assertEqualSetsWithIndex( 127 127 array( 128 128 array( -
trunk/tests/phpunit/tests/import/postmeta.php
r53864 r54402 77 77 $expected[] = $classy; 78 78 79 $this->assertEqual s( $expected, get_post_meta( 150, 'test', true ) );79 $this->assertEqualSets( $expected, get_post_meta( 150, 'test', true ) ); 80 80 } 81 81 -
trunk/tests/phpunit/tests/media.php
r54226 r54402 502 502 503 503 $images = get_attached_media( 'image', $post_id ); 504 $this->assertEqual s( $images, array( $attachment_id => get_post( $attachment_id ) ) );504 $this->assertEqualSets( $images, array( $attachment_id => get_post( $attachment_id ) ) ); 505 505 } 506 506 -
trunk/tests/phpunit/tests/multisite/network.php
r54088 r54402 172 172 wp_update_network_counts(); 173 173 174 $this->assert Equals( $site_count_start, $actual );174 $this->assertSame( $site_count_start, $actual ); 175 175 } 176 176 … … 192 192 wp_update_network_counts(); 193 193 194 $this->assert Equals( $site_count_start + 1, $actual );194 $this->assertSame( $site_count_start + 1, $actual ); 195 195 } 196 196 … … 203 203 $site_count = get_blog_count( self::$different_network_id ); 204 204 205 $this->assertEquals( count( self::$different_site_ids ), $site_count ); 206 } 207 208 205 $this->assertSame( count( self::$different_site_ids ), $site_count ); 206 } 209 207 210 208 public function test_active_network_plugins() { -
trunk/tests/phpunit/tests/multisite/site.php
r54088 r54402 1556 1556 $site3 = get_site( $site_id ); 1557 1557 1558 $this->assert Equals( 1, $site1->public );1559 $this->assert Equals( 0, $site2->public );1560 $this->assert Equals( 1, $site3->public );1558 $this->assertSame( '1', $site1->public ); 1559 $this->assertSame( '0', $site2->public ); 1560 $this->assertSame( '1', $site3->public ); 1561 1561 } 1562 1562 … … 2434 2434 wpmu_create_blog( 'testsite1.example.org', '/new-blog/', 'New Blog', get_current_user_id(), $meta, 1 ); 2435 2435 2436 $this->assert Equals( $expected_meta, $this->wp_initialize_site_meta );2436 $this->assertSameSetsWithIndex( $expected_meta, $this->wp_initialize_site_meta ); 2437 2437 2438 2438 $this->wp_initialize_site_meta = array(); … … 2535 2535 array( 2536 2536 'public' => 0, 2537 'foo' => 'bar', 2537 2538 'WPLANG' => 'en_US', 2538 'foo' => 'bar',2539 2539 ), 2540 2540 ), -
trunk/tests/phpunit/tests/option/networkOption.php
r54080 r54402 177 177 178 178 // Check they exists. 179 $this->assertEqual s( $funky_meta, get_network_option( $network_id, $option ) );179 $this->assertEqualSets( $funky_meta, get_network_option( $network_id, $option ) ); 180 180 } 181 181 … … 191 191 add_metadata( 'site', $network_id, $option, 'tuesday', true ); 192 192 add_metadata( 'site', $network_id, $option, 'wednesday', true ); 193 $this->assert Equals( 'monday', get_network_option( $network_id, $option, true ) );193 $this->assertSame( 'monday', get_network_option( $network_id, $option, true ) ); 194 194 } 195 195 … … 280 280 281 281 add_metadata( 'site', $network_id, $option, $array_w_object, true ); 282 $this->assertEqual s( $array_w_object, get_network_option( $network_id, $option ) );282 $this->assertEqualSets( $array_w_object, get_network_option( $network_id, $option ) ); 283 283 } 284 284 -
trunk/tests/phpunit/tests/post/getPages.php
r52010 r54402 425 425 ); 426 426 // Confirm the defaults. 427 $this->assertEqual s( $pages, $pages_default_args );427 $this->assertEqualSets( $pages, $pages_default_args ); 428 428 429 429 /* … … 469 469 ); 470 470 471 $this->assertEqual s( $pages, $default_args );471 $this->assertEqualSets( $pages, $default_args ); 472 472 473 473 /* -
trunk/tests/phpunit/tests/post/meta.php
r52389 r54402 249 249 250 250 // Check it exists. 251 $this->assertEqual s( $funky_meta, get_post_meta( self::$post_id, 'test_funky_post_meta', true ) );251 $this->assertEqualSets( $funky_meta, get_post_meta( self::$post_id, 'test_funky_post_meta', true ) ); 252 252 253 253 } -
trunk/tests/phpunit/tests/post/wpInsertPost.php
r54088 r54402 901 901 $assigned_terms = wp_get_object_terms( array( $post_id ), array( 'category' ), array() ); 902 902 $this->assertCount( 1, $assigned_terms ); 903 $this->assert Equals( $term_id, $assigned_terms[0]->term_id );903 $this->assertSame( $term_id, $assigned_terms[0]->term_id ); 904 904 905 905 // Update the post with no changes. … … 910 910 $assigned_terms = wp_get_object_terms( array( $post_id ), array( 'category' ), array() ); 911 911 $this->assertCount( 1, $assigned_terms ); 912 $this->assert Equals( $term_id, $assigned_terms[0]->term_id );912 $this->assertSame( $term_id, $assigned_terms[0]->term_id ); 913 913 914 914 // Remove the term from the post. -
trunk/tests/phpunit/tests/query/date.php
r51568 r54402 299 299 ); 300 300 301 $this->assertEqual s( $expected, $posts );301 $this->assertEqualSets( $expected, $posts ); 302 302 } 303 303 -
trunk/tests/phpunit/tests/rest-api/rest-block-renderer-controller.php
r54058 r54402 422 422 423 423 $this->assertSame( $expected_attributes, json_decode( $data['rendered'], true ) ); 424 $this->assertEqual s(424 $this->assertEqualSetsWithIndex( 425 425 json_decode( $block_type->render( $attributes ), true ), 426 426 json_decode( $data['rendered'], true ) -
trunk/tests/phpunit/tests/rest-api/rest-global-styles-controller.php
r54058 r54402 372 372 $links = $response->get_links(); 373 373 374 $this->assertEqual s(374 $this->assertEqualSets( 375 375 array( 376 376 'id' => self::$global_styles_id, … … 410 410 $response = rest_get_server()->dispatch( $request ); 411 411 $data = $response->get_data(); 412 $this->assert Equals( 'My new global styles title', $data['title']['raw'] );412 $this->assertSame( 'My new global styles title', $data['title']['raw'] ); 413 413 } 414 414 -
trunk/tests/phpunit/tests/rest-api/rest-post-meta-fields.php
r54090 r54402 2798 2798 2799 2799 $this->assertSame( 200, $response->get_status() ); 2800 $this->assert Equals( array( 0), $response->get_data()['meta']['multi_boolean'] );2800 $this->assertSameSetsWithIndex( array( false ), $response->get_data()['meta']['multi_boolean'] ); 2801 2801 2802 2802 $this->assertFalse( get_metadata_by_mid( 'post', $mid1 ) ); -
trunk/tests/phpunit/tests/rest-api/rest-site-health-controller.php
r54043 r54402 117 117 118 118 $route = current( $route ); 119 $this->assert Equals(119 $this->assertSame( 120 120 array( WP_REST_Server::READABLE => true ), 121 121 $route['methods'] 122 122 ); 123 123 124 $this->assert Equals(124 $this->assertSame( 125 125 'test_page_cache', 126 126 $route['callback'][1] -
trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php
r54176 r54402 629 629 $this->assertArrayHasKey( 'theme_supports', $result[0] ); 630 630 $this->assertArrayHasKey( 'editor-font-sizes', $result[0]['theme_supports'] ); 631 $this->assertEqual s( array( $tiny ), $result[0]['theme_supports']['editor-font-sizes'] );631 $this->assertEqualSetsWithIndex( array( $tiny ), $result[0]['theme_supports']['editor-font-sizes'] ); 632 632 } 633 633 -
trunk/tests/phpunit/tests/rest-api/wpRestTemplatesController.php
r54269 r54402 344 344 public function test_sanitize_template_id( $input_id, $sanitized_id ) { 345 345 $endpoint = new WP_REST_Templates_Controller( 'wp_template' ); 346 $this->assert Equals(346 $this->assertSame( 347 347 $sanitized_id, 348 348 $endpoint->_sanitize_template_id( $input_id ) -
trunk/tests/phpunit/tests/style-engine/wpStyleEngineCssRulesStore.php
r54156 r54402 89 89 $quesadilla_store = WP_Style_Engine_CSS_Rules_Store::get_store( 'quesadilla' ); 90 90 91 $this->assert Equals(91 $this->assertSame( 92 92 array( 93 93 'burrito' => $burrito_store, … … 109 109 $tzatziki_store = WP_Style_Engine_CSS_Rules_Store::get_store( 'tzatziki' ); 110 110 111 $this->assert Equals(111 $this->assertSame( 112 112 array( 113 113 'dolmades' => $dolmades_store, … … 120 120 WP_Style_Engine_CSS_Rules_Store::remove_all_stores(); 121 121 122 $this->assert Equals(122 $this->assertSame( 123 123 array(), 124 124 WP_Style_Engine_CSS_Rules_Store::get_stores(), -
trunk/tests/phpunit/tests/term.php
r54091 r54402 76 76 ); 77 77 // There are 5 posts, all Uncategorized. 78 $this->assert Equals( 1, $count );78 $this->assertSame( '1', $count ); 79 79 } 80 80 … … 87 87 // Counts all terms (1 default category, 5 tags). 88 88 $count = wp_count_terms(); 89 $this->assert Equals( 6, $count );89 $this->assertSame( '6', $count ); 90 90 91 91 // Counts only tags (5), with both current and legacy signature. … … 93 93 $count = wp_count_terms( array( 'taxonomy' => 'post_tag' ) ); 94 94 $legacy_count = wp_count_terms( 'post_tag' ); 95 $this->assert Equals( 5, $count );96 $this->assert Equals( $count, $legacy_count );95 $this->assertSame( '5', $count ); 96 $this->assertSame( $count, $legacy_count ); 97 97 } 98 98 … … 160 160 $this->assertNotWPError( $t ); 161 161 $this->assertGreaterThan( 0, $t ); 162 $this->assert Equals( $initial_count + 1, wp_count_terms( array( 'taxonomy' => 'category' ) ) );162 $this->assertSame( (string) ( $initial_count + 1 ), wp_count_terms( array( 'taxonomy' => 'category' ) ) ); 163 163 164 164 // Make sure the term exists. … … 170 170 $this->assertNull( term_exists( $term ) ); 171 171 $this->assertNull( term_exists( $t ) ); 172 $this->assert Equals( $initial_count, wp_count_terms( array( 'taxonomy' => 'category' ) ) );172 $this->assertSame( $initial_count, wp_count_terms( array( 'taxonomy' => 'category' ) ) ); 173 173 } 174 174 -
trunk/tests/phpunit/tests/term/getTerms.php
r53496 r54402 256 256 ) 257 257 ); 258 $this->assert Equals(258 $this->assertSameSetsWithIndex( 259 259 array( 260 260 $term_id1 => 0, … … 289 289 ) 290 290 ); 291 $this->assert Equals(291 $this->assertSameSetsWithIndex( 292 292 array( 293 293 $term_id1 => 'WOO!', … … 304 304 ) 305 305 ); 306 $this->assert Equals(306 $this->assertSameSetsWithIndex( 307 307 array( 308 308 $term_id1 => 'woo', -
trunk/tests/phpunit/tests/term/taxQuery.php
r51568 r54402 60 60 ); 61 61 62 $this->assert Equals( $expected, $tq->queries[0] );62 $this->assertSameSetsWithIndex( $expected, $tq->queries[0] ); 63 63 } 64 64 … … 83 83 ); 84 84 85 $this->assert Equals( $expected, $tq->queries[0] );85 $this->assertSameSetsWithIndex( $expected, $tq->queries[0] ); 86 86 } 87 87 … … 263 263 $tq->transform_query( $tq->queries[0], 'term_taxonomy_id' ); 264 264 265 $this->assertEqual s( $tt_ids, $tq->queries[0]['terms'] );265 $this->assertEqualSets( $tt_ids, $tq->queries[0]['terms'] ); 266 266 $this->assertSame( 'term_taxonomy_id', $tq->queries[0]['field'] ); 267 267 } -
trunk/tests/phpunit/tests/theme/wpThemeJson.php
r54362 r54402 677 677 $theme_json->get_stylesheet( array( 'presets' ) ) 678 678 ); 679 679 680 $this->assertSame( 680 681 'body{--wp--preset--color--grey: grey;--wp--preset--color--dark-grey: grey;--wp--preset--color--light-grey: grey;--wp--preset--color--white-2-black: grey;--wp--custom--white-2-black: value;}', … … 3353 3354 ); 3354 3355 3355 $this->assert Equals(3356 $this->assertSame( 3356 3357 'body { margin: 0; }.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }.wp-site-blocks > .alignright { float: right; margin-left: 2em; }.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }.wp-site-blocks > * + * { margin-block-start: 1rem; }body { --wp--style--block-gap: 1rem; }body .is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}body .is-layout-flow > * + *{margin-block-start: 1rem;margin-block-end: 0;}body .is-layout-flex{gap: 1rem;}body .is-layout-flow > .alignleft{float: left;margin-inline-start: 0;margin-inline-end: 2em;}body .is-layout-flow > .alignright{float: right;margin-inline-start: 2em;margin-inline-end: 0;}body .is-layout-flow > .aligncenter{margin-left: auto !important;margin-right: auto !important;}body .is-layout-flex{display: flex;}body .is-layout-flex{flex-wrap: wrap;align-items: center;}.wp-block-post-content{color: gray;}.wp-block-social-links.is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}.wp-block-social-links.is-layout-flow > * + *{margin-block-start: 0;margin-block-end: 0;}.wp-block-social-links.is-layout-flex{gap: 0;}.wp-block-buttons.is-layout-flow > *{margin-block-start: 0;margin-block-end: 0;}.wp-block-buttons.is-layout-flow > * + *{margin-block-start: 0;margin-block-end: 0;}.wp-block-buttons.is-layout-flex{gap: 0;}', 3357 3358 $theme_json->get_stylesheet() -
trunk/tests/phpunit/tests/theme/wpThemeJsonResolver.php
r54186 r54402 367 367 } 368 368 $query_count = count( $this->queries ) - $query_count; 369 $this->assert Equals( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' );369 $this->assertSame( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' ); 370 370 371 371 $user_cpt = WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles( $theme ); … … 382 382 } 383 383 $query_count = count( $this->queries ) - $query_count; 384 $this->assert Equals( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' );384 $this->assertSame( 0, $query_count, 'Unexpected SQL queries detected for the wp_global_style post type' ); 385 385 remove_filter( 'query', array( $this, 'filter_db_query' ) ); 386 386 } -
trunk/tests/phpunit/tests/user.php
r54088 r54402 561 561 wp_set_current_user( self::$author_id ); 562 562 $counts = count_many_users_posts( array( self::$author_id, $user_id_b ), 'post', false ); 563 $this->assert Equals( 1, $counts[ self::$author_id ] );564 $this->assert Equals( 1, $counts[ $user_id_b ] );563 $this->assertSame( '1', $counts[ self::$author_id ] ); 564 $this->assertSame( '1', $counts[ $user_id_b ] ); 565 565 566 566 $counts = count_many_users_posts( array( self::$author_id, $user_id_b ), 'post', true ); 567 $this->assert Equals( 1, $counts[ self::$author_id ] );568 $this->assert Equals( 1, $counts[ $user_id_b ] );567 $this->assertSame( '1', $counts[ self::$author_id ] ); 568 $this->assertSame( '1', $counts[ $user_id_b ] ); 569 569 570 570 wp_set_current_user( $user_id_b ); 571 571 $counts = count_many_users_posts( array( self::$author_id, $user_id_b ), 'post', false ); 572 $this->assert Equals( 1, $counts[ self::$author_id ] );573 $this->assert Equals( 2, $counts[ $user_id_b ] );572 $this->assertSame( '1', $counts[ self::$author_id ] ); 573 $this->assertSame( '2', $counts[ $user_id_b ] ); 574 574 575 575 $counts = count_many_users_posts( array( self::$author_id, $user_id_b ), 'post', true ); 576 $this->assert Equals( 1, $counts[ self::$author_id ] );577 $this->assert Equals( 1, $counts[ $user_id_b ] );576 $this->assertSame( '1', $counts[ self::$author_id ] ); 577 $this->assertSame( '1', $counts[ $user_id_b ] ); 578 578 } 579 579 -
trunk/tests/phpunit/tests/user/countUserPosts.php
r51568 r54402 60 60 61 61 public function test_count_user_posts_post_type_should_default_to_post() { 62 $this->assert Equals( 4, count_user_posts( self::$user_id ) );62 $this->assertSame( '4', count_user_posts( self::$user_id ) ); 63 63 } 64 64 … … 67 67 */ 68 68 public function test_count_user_posts_post_type_post() { 69 $this->assert Equals( 4, count_user_posts( self::$user_id, 'post' ) );69 $this->assertSame( '4', count_user_posts( self::$user_id, 'post' ) ); 70 70 } 71 71 … … 74 74 */ 75 75 public function test_count_user_posts_post_type_cpt() { 76 $this->assert Equals( 3, count_user_posts( self::$user_id, 'wptests_pt' ) );76 $this->assertSame( '3', count_user_posts( self::$user_id, 'wptests_pt' ) ); 77 77 } 78 78 … … 81 81 */ 82 82 public function test_count_user_posts_with_multiple_post_types() { 83 $this->assert Equals( 7, count_user_posts( self::$user_id, array( 'wptests_pt', 'post' ) ) );83 $this->assertSame( '7', count_user_posts( self::$user_id, array( 'wptests_pt', 'post' ) ) ); 84 84 } 85 85 … … 88 88 */ 89 89 public function test_count_user_posts_should_ignore_non_existent_post_types() { 90 $this->assert Equals( 4, count_user_posts( self::$user_id, array( 'foo', 'post' ) ) );90 $this->assertSame( '4', count_user_posts( self::$user_id, array( 'foo', 'post' ) ) ); 91 91 } 92 92 } -
trunk/tests/phpunit/tests/user/countUsers.php
r52010 r54402 54 54 55 55 $this->assertSame( 8, $count['total_users'] ); 56 $this->assert Equals(56 $this->assertSameSetsWithIndex( 57 57 array( 58 58 'administrator' => 2, … … 134 134 135 135 $this->assertSame( 8, $count['total_users'] ); 136 $this->assert Equals(136 $this->assertSameSetsWithIndex( 137 137 array( 138 138 'administrator' => 2, … … 152 152 153 153 $this->assertSame( 2, $count['total_users'] ); 154 $this->assert Equals(154 $this->assertSameSetsWithIndex( 155 155 array( 156 156 'administrator' => 1, … … 167 167 168 168 $this->assertSame( 2, $count['total_users'] ); 169 $this->assert Equals(169 $this->assertSameSetsWithIndex( 170 170 array( 171 171 'administrator' => 1, … … 240 240 241 241 $this->assertSame( 3, $count['total_users'] ); 242 $this->assert Equals(242 $this->assertSameSetsWithIndex( 243 243 array( 244 244 'administrator' => 2, -
trunk/tests/phpunit/tests/user/query.php
r54090 r54402 53 53 $users = new WP_User_Query(); 54 54 55 $this->assert Equals( '',$users->get( 'fields' ) );55 $this->assertNull( $users->get( 'fields' ) ); 56 56 if ( isset( $users->query_vars['fields'] ) ) { 57 57 $this->assertSame( '', $users->query_vars['fields'] ); … … 583 583 $query->prepare_query( array( 'fields' => 'all' ) ); 584 584 $this->assertEmpty( $query->query_limit ); 585 $this->assert Equals( '',$query->query_limit );585 $this->assertNull( $query->query_limit ); 586 586 $_query_vars = $query->query_vars; 587 587 … … 1686 1686 1687 1687 // Must include user that has the same string in display_name. 1688 $this->assert Equals( array($new_user1 ), $ids );1688 $this->assertSameSetsWithIndex( array( (string) $new_user1 ), $ids ); 1689 1689 } 1690 1690 -
trunk/tests/phpunit/tests/widgets.php
r54112 r54402 1275 1275 1276 1276 $expected_sidebars = array( 1277 'wp_inactive_widgets' => array(), 1277 1278 'primary' => 1, 1278 'wp_inactive_widgets' => array(), 1279 ); 1280 $this->assertEquals( $expected_sidebars, $new_next_theme_sidebars ); 1279 ); 1280 $this->assertSameSetsWithIndex( $expected_sidebars, $new_next_theme_sidebars ); 1281 1281 } 1282 1282 … … 1296 1296 $new_next_theme_sidebars = wp_map_sidebars_widgets( $prev_theme_sidebars ); 1297 1297 1298 $this->assert Equals( $prev_theme_sidebars, $new_next_theme_sidebars );1298 $this->assertSameSetsWithIndex( $prev_theme_sidebars, $new_next_theme_sidebars ); 1299 1299 } 1300 1300 … … 1319 1319 'wp_inactive_widgets' => array(), 1320 1320 ); 1321 $this->assert Equals( $expected_sidebars, $new_next_theme_sidebars );1321 $this->assertSameSetsWithIndex( $expected_sidebars, $new_next_theme_sidebars ); 1322 1322 } 1323 1323 … … 1363 1363 'wp_inactive_widgets' => array(), 1364 1364 ); 1365 $this->assert Equals( $expected_sidebars, $new_next_theme_sidebars );1365 $this->assertSameSetsWithIndex( $expected_sidebars, $new_next_theme_sidebars ); 1366 1366 } 1367 1367 } -
trunk/tests/phpunit/tests/widgets/wpWidgetMedia.php
r54088 r54402 344 344 $widget->widget( $args, $instance ); 345 345 $this->assertCount( 3, $this->widget_instance_filter_args ); 346 $this->assert Equals( $instance, $this->widget_instance_filter_args[0] );346 $this->assertSameSetsWithIndex( $instance, $this->widget_instance_filter_args[0] ); 347 347 $this->assertSame( $args, $this->widget_instance_filter_args[1] ); 348 348 $this->assertSame( $widget, $this->widget_instance_filter_args[2] ); -
trunk/tests/phpunit/tests/xmlrpc/wp/newPost.php
r52010 r54402 239 239 $result = $this->myxmlrpcserver->wp_newPost( array( 1, 'editor', 'editor', $post ) ); 240 240 $this->assertNotIXRError( $result ); 241 $this->assert Equals( '',get_post_format( $result ) );241 $this->assertFalse( get_post_format( $result ) ); 242 242 } 243 243
Note: See TracChangeset
for help on using the changeset viewer.