Make WordPress Core


Ignore:
Timestamp:
09/02/2020 12:35:36 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Tests: First pass at using assertSame() instead of assertEquals() in most of the unit tests.

This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using assertSame() should generally be preferred to assertEquals() where appropriate, to make the tests more reliable.

Props johnbillion, jrf, SergeyBiryukov.
See #38266.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/customize/nav-menus.php

    r48858 r48937  
    4747        $items[] = array(
    4848            'title'      => 'Custom',
     49            'type_label' => 'Custom Type',
    4950            'type'       => 'custom_type',
    5051            'object'     => 'custom_object',
    51             'type_label' => 'Custom Type',
    5252        );
    5353
     
    8787        $this->assertInstanceOf( 'WP_Customize_Manager', $menus->manager );
    8888
    89         $this->assertEquals( 10, add_filter( 'customize_refresh_nonces', array( $menus, 'filter_nonces' ) ) );
    90         $this->assertEquals( 10, add_action( 'wp_ajax_load-available-menu-items-customizer', array( $menus, 'ajax_load_available_items' ) ) );
    91         $this->assertEquals( 10, add_action( 'wp_ajax_search-available-menu-items-customizer', array( $menus, 'ajax_search_available_items' ) ) );
    92         $this->assertEquals( 10, add_action( 'wp_ajax_customize-nav-menus-insert-auto-draft', array( $menus, 'ajax_insert_auto_draft_post' ) ) );
    93         $this->assertEquals( 10, add_action( 'customize_controls_enqueue_scripts', array( $menus, 'enqueue_scripts' ) ) );
    94         $this->assertEquals( 11, add_action( 'customize_register', array( $menus, 'customize_register' ) ) );
    95         $this->assertEquals( 10, add_filter( 'customize_dynamic_setting_args', array( $menus, 'filter_dynamic_setting_args' ) ) );
    96         $this->assertEquals( 10, add_filter( 'customize_dynamic_setting_class', array( $menus, 'filter_dynamic_setting_class' ) ) );
    97         $this->assertEquals( 10, add_action( 'customize_controls_print_footer_scripts', array( $menus, 'print_templates' ) ) );
    98         $this->assertEquals( 10, add_action( 'customize_controls_print_footer_scripts', array( $menus, 'available_items_template' ) ) );
    99         $this->assertEquals( 10, add_action( 'customize_preview_init', array( $menus, 'customize_preview_init' ) ) );
    100         $this->assertEquals( 10, add_action( 'customize_preview_init', array( $menus, 'make_auto_draft_status_previewable' ) ) );
    101         $this->assertEquals( 10, add_action( 'customize_save_nav_menus_created_posts', array( $menus, 'save_nav_menus_created_posts' ) ) );
    102         $this->assertEquals( 10, add_filter( 'customize_dynamic_partial_args', array( $menus, 'customize_dynamic_partial_args' ) ) );
     89        $this->assertTrue( add_filter( 'customize_refresh_nonces', array( $menus, 'filter_nonces' ) ) );
     90        $this->assertTrue( add_action( 'wp_ajax_load-available-menu-items-customizer', array( $menus, 'ajax_load_available_items' ) ) );
     91        $this->assertTrue( add_action( 'wp_ajax_search-available-menu-items-customizer', array( $menus, 'ajax_search_available_items' ) ) );
     92        $this->assertTrue( add_action( 'wp_ajax_customize-nav-menus-insert-auto-draft', array( $menus, 'ajax_insert_auto_draft_post' ) ) );
     93        $this->assertTrue( add_action( 'customize_controls_enqueue_scripts', array( $menus, 'enqueue_scripts' ) ) );
     94        $this->assertTrue( add_action( 'customize_register', array( $menus, 'customize_register' ) ) );
     95        $this->assertTrue( add_filter( 'customize_dynamic_setting_args', array( $menus, 'filter_dynamic_setting_args' ) ) );
     96        $this->assertTrue( add_filter( 'customize_dynamic_setting_class', array( $menus, 'filter_dynamic_setting_class' ) ) );
     97        $this->assertTrue( add_action( 'customize_controls_print_footer_scripts', array( $menus, 'print_templates' ) ) );
     98        $this->assertTrue( add_action( 'customize_controls_print_footer_scripts', array( $menus, 'available_items_template' ) ) );
     99        $this->assertTrue( add_action( 'customize_preview_init', array( $menus, 'customize_preview_init' ) ) );
     100        $this->assertTrue( add_action( 'customize_preview_init', array( $menus, 'make_auto_draft_status_previewable' ) ) );
     101        $this->assertTrue( add_action( 'customize_save_nav_menus_created_posts', array( $menus, 'save_nav_menus_created_posts' ) ) );
     102        $this->assertTrue( add_filter( 'customize_dynamic_partial_args', array( $menus, 'customize_dynamic_partial_args' ) ) );
    103103    }
    104104
     
    114114        $items = $menus->load_available_items_query( 'post_type', 'invalid' );
    115115        $this->assertInstanceOf( 'WP_Error', $items );
    116         $this->assertEquals( 'nav_menus_invalid_post_type', $items->get_error_code() );
     116        $this->assertSame( 'nav_menus_invalid_post_type', $items->get_error_code() );
    117117
    118118        // Invalid taxonomy $obj_name.
    119119        $items = $menus->load_available_items_query( 'taxonomy', 'invalid' );
    120120        $this->assertInstanceOf( 'WP_Error', $items );
    121         $this->assertEquals( 'invalid_taxonomy', $items->get_error_code() );
     121        $this->assertSame( 'invalid_taxonomy', $items->get_error_code() );
    122122    }
    123123
     
    318318            )
    319319        );
    320         $this->assertEquals( $expected, $results );
     320        $this->assertSame( $expected, $results );
    321321
    322322        // Test posts.
     
    340340                )
    341341            );
    342             $this->assertEquals( $expected, $results[0] );
     342            $this->assertSame( $expected, $results[0] );
    343343        }
    344344
     
    362362                )
    363363            );
    364             $this->assertEquals( $expected, $results[0] );
     364            $this->assertSame( $expected, $results[0] );
    365365        }
    366366
     
    381381            )
    382382        );
    383         $this->assertEquals( $count + 1, $this->filter_count_customize_nav_menu_searched_items );
     383        $this->assertSame( $count + 1, $this->filter_count_customize_nav_menu_searched_items );
    384384        $this->assertInternalType( 'array', $results );
    385385        $this->assertCount( 3, $results );
     
    395395        );
    396396        $this->assertCount( 1, $results );
    397         $this->assertEquals( 'home', $results[0]['id'] );
    398         $this->assertEquals( 'custom', $results[0]['type'] );
     397        $this->assertSame( 'home', $results[0]['id'] );
     398        $this->assertSame( 'custom', $results[0]['type'] );
    399399    }
    400400
     
    513513        $expected = array( 'type' => 'nav_menu_item' );
    514514        $results  = $menus->filter_dynamic_setting_args( $this->wp_customize, 'nav_menu_item[123]' );
    515         $this->assertEquals( $expected['type'], $results['type'] );
     515        $this->assertSame( $expected['type'], $results['type'] );
    516516
    517517        $expected = array( 'type' => 'nav_menu' );
    518518        $results  = $menus->filter_dynamic_setting_args( $this->wp_customize, 'nav_menu[123]' );
    519         $this->assertEquals( $expected['type'], $results['type'] );
     519        $this->assertSame( $expected['type'], $results['type'] );
    520520    }
    521521
     
    531531        $expected = 'WP_Customize_Nav_Menu_Item_Setting';
    532532        $results  = $menus->filter_dynamic_setting_class( 'WP_Customize_Setting', 'nav_menu_item[123]', array( 'type' => 'nav_menu_item' ) );
    533         $this->assertEquals( $expected, $results );
     533        $this->assertSame( $expected, $results );
    534534
    535535        $expected = 'WP_Customize_Nav_Menu_Setting';
    536536        $results  = $menus->filter_dynamic_setting_class( 'WP_Customize_Setting', 'nav_menu[123]', array( 'type' => 'nav_menu' ) );
    537         $this->assertEquals( $expected, $results );
     537        $this->assertSame( $expected, $results );
    538538    }
    539539
     
    560560        do_action( 'customize_register', $this->wp_customize );
    561561        $this->assertInstanceOf( 'WP_Customize_Nav_Menu_Item_Setting', $this->wp_customize->get_setting( "nav_menu_item[$item_id]" ) );
    562         $this->assertEquals( 'Primary', $this->wp_customize->get_section( "nav_menu[$menu_id]" )->title );
    563         $this->assertEquals( 'Hello World', $this->wp_customize->get_control( "nav_menu_item[$item_id]" )->label );
     562        $this->assertSame( 'Primary', $this->wp_customize->get_section( "nav_menu[$menu_id]" )->title );
     563        $this->assertSame( 'Hello World', $this->wp_customize->get_control( "nav_menu_item[$item_id]" )->label );
    564564
    565565        $nav_menus_created_posts_setting = $this->wp_customize->get_setting( 'nav_menus_created_posts' );
    566566        $this->assertInstanceOf( 'WP_Customize_Filter_Setting', $nav_menus_created_posts_setting );
    567         $this->assertEquals( 'postMessage', $nav_menus_created_posts_setting->transport );
    568         $this->assertEquals( array(), $nav_menus_created_posts_setting->default );
    569         $this->assertEquals( array( $this->wp_customize->nav_menus, 'sanitize_nav_menus_created_posts' ), $nav_menus_created_posts_setting->sanitize_callback );
     567        $this->assertSame( 'postMessage', $nav_menus_created_posts_setting->transport );
     568        $this->assertSame( array(), $nav_menus_created_posts_setting->default );
     569        $this->assertSame( array( $this->wp_customize->nav_menus, 'sanitize_nav_menus_created_posts' ), $nav_menus_created_posts_setting->sanitize_callback );
    570570    }
    571571
     
    579579        $menus = new WP_Customize_Nav_Menus( $this->wp_customize );
    580580
    581         $this->assertEquals( 2, $menus->intval_base10( 2 ) );
    582         $this->assertEquals( 4, $menus->intval_base10( 4.1 ) );
    583         $this->assertEquals( 4, $menus->intval_base10( '4' ) );
    584         $this->assertEquals( 4, $menus->intval_base10( '04' ) );
    585         $this->assertEquals( 42, $menus->intval_base10( +42 ) );
    586         $this->assertEquals( -42, $menus->intval_base10( -42 ) );
    587         $this->assertEquals( 26, $menus->intval_base10( 0x1A ) );
    588         $this->assertEquals( 0, $menus->intval_base10( array() ) );
     581        $this->assertSame( 2, $menus->intval_base10( 2 ) );
     582        $this->assertSame( 4, $menus->intval_base10( 4.1 ) );
     583        $this->assertSame( 4, $menus->intval_base10( '4' ) );
     584        $this->assertSame( 4, $menus->intval_base10( '04' ) );
     585        $this->assertSame( 42, $menus->intval_base10( +42 ) );
     586        $this->assertSame( -42, $menus->intval_base10( -42 ) );
     587        $this->assertSame( 26, $menus->intval_base10( 0x1A ) );
     588        $this->assertSame( 0, $menus->intval_base10( array() ) );
    589589    }
    590590
     
    601601            array(
    602602                'title'      => 'Posts',
     603                'type_label' => __( 'Post' ),
    603604                'type'       => 'post_type',
    604605                'object'     => 'post',
    605                 'type_label' => __( 'Post' ),
    606606            ),
    607607            array(
    608608                'title'      => 'Pages',
     609                'type_label' => __( 'Page' ),
    609610                'type'       => 'post_type',
    610611                'object'     => 'page',
    611                 'type_label' => __( 'Page' ),
    612612            ),
    613613            array(
    614614                'title'      => 'Categories',
     615                'type_label' => __( 'Category' ),
    615616                'type'       => 'taxonomy',
    616617                'object'     => 'category',
    617                 'type_label' => __( 'Category' ),
    618618            ),
    619619            array(
    620620                'title'      => 'Tags',
     621                'type_label' => __( 'Tag' ),
    621622                'type'       => 'taxonomy',
    622623                'object'     => 'post_tag',
    623                 'type_label' => __( 'Tag' ),
    624624            ),
    625625        );
     
    628628            $expected[] = array(
    629629                'title'      => 'Format',
     630                'type_label' => __( 'Format' ),
    630631                'type'       => 'taxonomy',
    631632                'object'     => 'post_format',
    632                 'type_label' => __( 'Format' ),
    633633            );
    634634        }
    635635
    636         $this->assertEquals( $expected, $menus->available_item_types() );
     636        $this->assertSame( $expected, $menus->available_item_types() );
    637637
    638638        register_taxonomy( 'wptests_tax', array( 'post' ), array( 'labels' => array( 'name' => 'Foo' ) ) );
    639639        $expected[] = array(
    640640            'title'      => 'Foo',
     641            'type_label' => 'Foo',
    641642            'type'       => 'taxonomy',
    642643            'object'     => 'wptests_tax',
    643             'type_label' => 'Foo',
    644         );
    645 
    646         $this->assertEquals( $expected, $menus->available_item_types() );
     644        );
     645
     646        $this->assertSame( $expected, $menus->available_item_types() );
    647647
    648648        $expected[] = array(
    649649            'title'      => 'Custom',
     650            'type_label' => 'Custom Type',
    650651            'type'       => 'custom_type',
    651652            'object'     => 'custom_object',
    652             'type_label' => 'Custom Type',
    653653        );
    654654
    655655        add_filter( 'customize_nav_menu_available_item_types', array( $this, 'filter_item_types' ) );
    656         $this->assertEquals( $expected, $menus->available_item_types() );
     656        $this->assertSame( $expected, $menus->available_item_types() );
    657657        remove_filter( 'customize_nav_menu_available_item_types', array( $this, 'filter_item_types' ) );
    658658
     
    669669        $r = $menus->insert_auto_draft_post( array() );
    670670        $this->assertInstanceOf( 'WP_Error', $r );
    671         $this->assertEquals( 'unknown_post_type', $r->get_error_code() );
     671        $this->assertSame( 'unknown_post_type', $r->get_error_code() );
    672672
    673673        // Non-existent post types allowed as of #39610.
     
    679679        );
    680680        $this->assertInstanceOf( 'WP_Post', $r );
    681         $this->assertEquals( $this->wp_customize->changeset_uuid(), get_post_meta( $r->ID, '_customize_changeset_uuid', true ) );
     681        $this->assertSame( $this->wp_customize->changeset_uuid(), get_post_meta( $r->ID, '_customize_changeset_uuid', true ) );
    682682
    683683        $r = $menus->insert_auto_draft_post( array( 'post_type' => 'post' ) );
    684684        $this->assertInstanceOf( 'WP_Error', $r );
    685         $this->assertEquals( 'empty_title', $r->get_error_code() );
     685        $this->assertSame( 'empty_title', $r->get_error_code() );
    686686
    687687        $r = $menus->insert_auto_draft_post(
     
    693693        );
    694694        $this->assertInstanceOf( 'WP_Error', $r );
    695         $this->assertEquals( 'status_forbidden', $r->get_error_code() );
     695        $this->assertSame( 'status_forbidden', $r->get_error_code() );
    696696
    697697        $r = $menus->insert_auto_draft_post(
     
    702702        );
    703703        $this->assertInstanceOf( 'WP_Post', $r );
    704         $this->assertEquals( 'Hello World', $r->post_title );
    705         $this->assertEquals( '', $r->post_name );
    706         $this->assertEquals( 'hello-world', get_post_meta( $r->ID, '_customize_draft_post_name', true ) );
    707         $this->assertEquals( $this->wp_customize->changeset_uuid(), get_post_meta( $r->ID, '_customize_changeset_uuid', true ) );
    708         $this->assertEquals( 'post', $r->post_type );
     704        $this->assertSame( 'Hello World', $r->post_title );
     705        $this->assertSame( '', $r->post_name );
     706        $this->assertSame( 'hello-world', get_post_meta( $r->ID, '_customize_draft_post_name', true ) );
     707        $this->assertSame( $this->wp_customize->changeset_uuid(), get_post_meta( $r->ID, '_customize_changeset_uuid', true ) );
     708        $this->assertSame( 'post', $r->post_type );
    709709
    710710        $r = $menus->insert_auto_draft_post(
     
    717717        );
    718718        $this->assertInstanceOf( 'WP_Post', $r );
    719         $this->assertEquals( 'Hello World', $r->post_title );
    720         $this->assertEquals( 'post', $r->post_type );
    721         $this->assertEquals( '', $r->post_name );
    722         $this->assertEquals( 'greetings-world', get_post_meta( $r->ID, '_customize_draft_post_name', true ) );
    723         $this->assertEquals( $this->wp_customize->changeset_uuid(), get_post_meta( $r->ID, '_customize_changeset_uuid', true ) );
    724         $this->assertEquals( 'Hi World', $r->post_content );
     719        $this->assertSame( 'Hello World', $r->post_title );
     720        $this->assertSame( 'post', $r->post_type );
     721        $this->assertSame( '', $r->post_name );
     722        $this->assertSame( 'greetings-world', get_post_meta( $r->ID, '_customize_draft_post_name', true ) );
     723        $this->assertSame( $this->wp_customize->changeset_uuid(), get_post_meta( $r->ID, '_customize_changeset_uuid', true ) );
     724        $this->assertSame( 'Hi World', $r->post_content );
    725725    }
    726726
     
    806806        $args = apply_filters( 'customize_dynamic_partial_args', false, 'nav_menu_instance[68b329da9893e34099c7d8ad5cb9c940]' );
    807807        $this->assertInternalType( 'array', $args );
    808         $this->assertEquals( 'nav_menu_instance', $args['type'] );
    809         $this->assertEquals( array( $this->wp_customize->nav_menus, 'render_nav_menu_partial' ), $args['render_callback'] );
     808        $this->assertSame( 'nav_menu_instance', $args['type'] );
     809        $this->assertSame( array( $this->wp_customize->nav_menus, 'render_nav_menu_partial' ), $args['render_callback'] );
    810810        $this->assertTrue( $args['container_inclusive'] );
    811811
    812812        $args = apply_filters( 'customize_dynamic_partial_args', array( 'fallback_refresh' => false ), 'nav_menu_instance[4099c7d8ad5cb9c94068b329da9893e3]' );
    813813        $this->assertInternalType( 'array', $args );
    814         $this->assertEquals( 'nav_menu_instance', $args['type'] );
    815         $this->assertEquals( array( $this->wp_customize->nav_menus, 'render_nav_menu_partial' ), $args['render_callback'] );
     814        $this->assertSame( 'nav_menu_instance', $args['type'] );
     815        $this->assertSame( array( $this->wp_customize->nav_menus, 'render_nav_menu_partial' ), $args['render_callback'] );
    816816        $this->assertTrue( $args['container_inclusive'] );
    817817        $this->assertFalse( $args['fallback_refresh'] );
     
    828828
    829829        $menus->customize_preview_init();
    830         $this->assertEquals( 10, has_action( 'wp_enqueue_scripts', array( $menus, 'customize_preview_enqueue_deps' ) ) );
    831         $this->assertEquals( 1000, has_filter( 'wp_nav_menu_args', array( $menus, 'filter_wp_nav_menu_args' ) ) );
    832         $this->assertEquals( 10, has_filter( 'wp_nav_menu', array( $menus, 'filter_wp_nav_menu' ) ) );
     830        $this->assertSame( 10, has_action( 'wp_enqueue_scripts', array( $menus, 'customize_preview_enqueue_deps' ) ) );
     831        $this->assertSame( 1000, has_filter( 'wp_nav_menu_args', array( $menus, 'filter_wp_nav_menu_args' ) ) );
     832        $this->assertSame( 10, has_filter( 'wp_nav_menu', array( $menus, 'filter_wp_nav_menu' ) ) );
    833833    }
    834834
     
    908908        wp_set_current_user( $contributor_user_id );
    909909        $sanitized = $menus->sanitize_nav_menus_created_posts( $value );
    910         $this->assertEquals( array(), $sanitized );
     910        $this->assertSame( array(), $sanitized );
    911911
    912912        wp_set_current_user( $author_user_id );
    913913        $sanitized = $menus->sanitize_nav_menus_created_posts( $value );
    914         $this->assertEquals( array( $author_post_id ), $sanitized );
     914        $this->assertSame( array( $author_post_id ), $sanitized );
    915915
    916916        wp_set_current_user( $administrator_user_id );
    917917        $sanitized = $menus->sanitize_nav_menus_created_posts( $value );
    918         $this->assertEquals( array( $contributor_post_id, $author_post_id, $administrator_post_id, $draft_post_id ), $sanitized );
     918        $this->assertSame( array( $contributor_post_id, $author_post_id, $administrator_post_id, $draft_post_id ), $sanitized );
    919919    }
    920920
     
    997997        $setting = $this->wp_customize->get_setting( $setting_id );
    998998        $this->assertInstanceOf( 'WP_Customize_Filter_Setting', $setting );
    999         $this->assertEquals( array( $menus, 'sanitize_nav_menus_created_posts' ), $setting->sanitize_callback );
    1000         $this->assertEquals( $drafted_post_ids, $setting->post_value() );
     999        $this->assertSame( array( $menus, 'sanitize_nav_menus_created_posts' ), $setting->sanitize_callback );
     1000        $this->assertSame( $drafted_post_ids, $setting->post_value() );
    10011001        $this->assertArrayNotHasKey( $private_post_id, $post_ids );
    10021002        $this->assertArrayNotHasKey( $trashed_post_id, $post_ids );
    10031003
    1004         $this->assertEquals( 'auto-draft', get_post_status( $drafted_post_ids[0] ) );
    1005         $this->assertEquals( 'draft', get_post_status( $drafted_post_ids[1] ) );
     1004        $this->assertSame( 'auto-draft', get_post_status( $drafted_post_ids[0] ) );
     1005        $this->assertSame( 'draft', get_post_status( $drafted_post_ids[1] ) );
    10061006        foreach ( $drafted_post_ids as $post_id ) {
    10071007            $this->assertEmpty( get_post( $post_id )->post_name );
     
    10111011        $save_action_count = did_action( 'customize_save_nav_menus_created_posts' );
    10121012        $setting->save();
    1013         $this->assertEquals( $save_action_count + 1, did_action( 'customize_save_nav_menus_created_posts' ) );
     1013        $this->assertSame( $save_action_count + 1, did_action( 'customize_save_nav_menus_created_posts' ) );
    10141014        foreach ( $drafted_post_ids as $post_id ) {
    1015             $this->assertEquals( 'publish', get_post_status( $post_id ) );
     1015            $this->assertSame( 'publish', get_post_status( $post_id ) );
    10161016            $this->assertRegExp( '/^auto-draft-\d+$/', get_post( $post_id )->post_name );
    10171017            $this->assertEmpty( get_post_meta( $post_id, '_customize_draft_post_name', true ) );
    10181018        }
    10191019
    1020         $this->assertEquals( 'private', get_post_status( $private_post_id ) );
    1021         $this->assertEquals( 'trash', get_post_status( $trashed_post_id ) );
     1020        $this->assertSame( 'private', get_post_status( $private_post_id ) );
     1021        $this->assertSame( 'trash', get_post_status( $trashed_post_id ) );
    10221022
    10231023        // Ensure that unique slugs were assigned.
     
    10591059        $this->assertFalse( $results['can_partial_refresh'] );
    10601060        $this->assertArrayHasKey( 'customize_preview_nav_menus_args', $results );
    1061         $this->assertEquals( 'wp_page_menu', $results['fallback_cb'] );
     1061        $this->assertSame( 'wp_page_menu', $results['fallback_cb'] );
    10621062
    10631063        $nav_menu_term = get_term( wp_create_nav_menu( 'Bar' ) );
     
    10731073        $this->assertTrue( $results['can_partial_refresh'] );
    10741074        $this->assertArrayHasKey( 'customize_preview_nav_menus_args', $results );
    1075         $this->assertEquals( $nav_menu_term->term_id, $results['customize_preview_nav_menus_args']['menu'] );
     1075        $this->assertSame( $nav_menu_term->term_id, $results['customize_preview_nav_menus_args']['menu'] );
    10761076
    10771077        $results = $menus->filter_wp_nav_menu_args(
     
    11451145        $this->assertTrue( (bool) preg_match( '/data-customize-partial-placement-context="(.+?)"/', $result, $matches ) );
    11461146        $context = json_decode( html_entity_decode( $matches[1] ), true );
    1147         $this->assertEquals( $original_args, wp_array_slice_assoc( $context, array_keys( $original_args ) ) ); // Because assertArraySubset is not available in PHP 5.2.
     1147        $this->assertSame( $original_args, wp_array_slice_assoc( $context, array_keys( $original_args ) ) ); // Because assertArraySubset is not available in PHP 5.2.
    11481148        $this->assertTrue( $context['can_partial_refresh'] );
    11491149    }
     
    12111211        $this->assertNotEmpty( $partials );
    12121212        $partial = array_shift( $partials );
    1213         $this->assertEquals( $partial_id, $partial->id );
     1213        $this->assertSame( $partial_id, $partial->id );
    12141214
    12151215        $missing_args_hmac_args = array_merge(
Note: See TracChangeset for help on using the changeset viewer.