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/multisite/site.php

    r48200 r48937  
    9292            global $_wp_switched_stack, $wpdb;
    9393
    94             $this->assertEquals( array(), $_wp_switched_stack );
     94            $this->assertSame( array(), $_wp_switched_stack );
    9595            $this->assertFalse( ms_is_switched() );
    9696            $current_blog_id = get_current_blog_id();
     
    9898
    9999            wp_cache_set( 'switch-test', $current_blog_id, 'switch-test' );
    100             $this->assertEquals( $current_blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
     100            $this->assertSame( $current_blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
    101101
    102102            $blog_id = self::factory()->blog->create();
     
    105105            switch_to_blog( $blog_id );
    106106            $this->assertNotEquals( $cap_key, wp_get_current_user()->cap_key );
    107             $this->assertEquals( array( $current_blog_id ), $_wp_switched_stack );
     107            $this->assertSame( array( $current_blog_id ), $_wp_switched_stack );
    108108            $this->assertTrue( ms_is_switched() );
    109             $this->assertEquals( $blog_id, $wpdb->blogid );
     109            $this->assertSame( $blog_id, $wpdb->blogid );
    110110            $this->assertFalse( wp_cache_get( 'switch-test', 'switch-test' ) );
    111111            wp_cache_set( 'switch-test', $blog_id, 'switch-test' );
    112             $this->assertEquals( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
     112            $this->assertSame( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
    113113
    114114            switch_to_blog( $blog_id );
    115             $this->assertEquals( array( $current_blog_id, $blog_id ), $_wp_switched_stack );
     115            $this->assertSame( array( $current_blog_id, $blog_id ), $_wp_switched_stack );
    116116            $this->assertTrue( ms_is_switched() );
    117             $this->assertEquals( $blog_id, $wpdb->blogid );
    118             $this->assertEquals( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
     117            $this->assertSame( $blog_id, $wpdb->blogid );
     118            $this->assertSame( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
    119119
    120120            restore_current_blog();
    121             $this->assertEquals( array( $current_blog_id ), $_wp_switched_stack );
     121            $this->assertSame( array( $current_blog_id ), $_wp_switched_stack );
    122122            $this->assertTrue( ms_is_switched() );
    123             $this->assertEquals( $blog_id, $wpdb->blogid );
    124             $this->assertEquals( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
     123            $this->assertSame( $blog_id, $wpdb->blogid );
     124            $this->assertSame( $blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
    125125
    126126            restore_current_blog();
    127             $this->assertEquals( $cap_key, wp_get_current_user()->cap_key );
    128             $this->assertEquals( $current_blog_id, get_current_blog_id() );
    129             $this->assertEquals( array(), $_wp_switched_stack );
     127            $this->assertSame( $cap_key, wp_get_current_user()->cap_key );
     128            $this->assertSame( $current_blog_id, get_current_blog_id() );
     129            $this->assertSame( array(), $_wp_switched_stack );
    130130            $this->assertFalse( ms_is_switched() );
    131             $this->assertEquals( $current_blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
     131            $this->assertSame( $current_blog_id, wp_cache_get( 'switch-test', 'switch-test' ) );
    132132
    133133            $this->assertFalse( restore_current_blog() );
     
    154154
    155155            // get_blogaddress_by_name().
    156             $this->assertEquals( 'http://' . $details->domain . $details->path, get_blogaddress_by_name( trim( $details->path, '/' ) ) );
     156            $this->assertSame( 'http://' . $details->domain . $details->path, get_blogaddress_by_name( trim( $details->path, '/' ) ) );
    157157
    158158            // These are empty until get_blog_details() is called with $get_all = true.
    159             $this->assertEquals( false, wp_cache_get( $blog_id, 'blog-details' ) );
    160             $this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) );
     159            $this->assertFalse( wp_cache_get( $blog_id, 'blog-details' ) );
     160            $this->assertFalse( wp_cache_get( $key, 'blog-lookup' ) );
    161161
    162162            // $get_all = true, populate the full blog-details cache and the blog slug lookup cache.
     
    190190            // Update the blog count cache to use get_blog_count().
    191191            wp_update_network_counts();
    192             $this->assertEquals( 2, (int) get_blog_count() );
     192            $this->assertSame( 2, (int) get_blog_count() );
    193193        }
    194194
     
    216216            wp_suspend_cache_invalidation( $suspend );
    217217
    218             $this->assertEquals( $details->path, $new_details->path );
     218            $this->assertSame( $details->path, $new_details->path );
    219219        }
    220220
     
    231231            wpmu_delete_blog( $blog_id, false );
    232232
    233             $this->assertEquals( false, wp_cache_get( $blog_id, 'blog-details' ) );
    234             $this->assertEquals( false, wp_cache_get( $blog_id . 'short', 'blog-details' ) );
    235             $this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) );
    236             $this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) );
     233            $this->assertFalse( wp_cache_get( $blog_id, 'blog-details' ) );
     234            $this->assertFalse( wp_cache_get( $blog_id . 'short', 'blog-details' ) );
     235            $this->assertFalse( wp_cache_get( $key, 'blog-lookup' ) );
     236            $this->assertFalse( wp_cache_get( $key, 'blog-id-cache' ) );
    237237        }
    238238
     
    272272            wpmu_delete_blog( $blog_id, true );
    273273
    274             $this->assertEquals( false, wp_cache_get( $blog_id, 'blog-details' ) );
    275             $this->assertEquals( false, wp_cache_get( $blog_id . 'short', 'blog-details' ) );
    276             $this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) );
    277             $this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) );
     274            $this->assertFalse( wp_cache_get( $blog_id, 'blog-details' ) );
     275            $this->assertFalse( wp_cache_get( $blog_id . 'short', 'blog-details' ) );
     276            $this->assertFalse( wp_cache_get( $key, 'blog-lookup' ) );
     277            $this->assertFalse( wp_cache_get( $key, 'blog-id-cache' ) );
    278278        }
    279279
     
    313313            wpmu_delete_blog( $blog_id, true );
    314314
    315             $this->assertEquals( false, wp_cache_get( $blog_id, 'blog-details' ) );
    316             $this->assertEquals( false, wp_cache_get( $blog_id . 'short', 'blog-details' ) );
    317             $this->assertEquals( false, wp_cache_get( $key, 'blog-lookup' ) );
    318             $this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) );
     315            $this->assertFalse( wp_cache_get( $blog_id, 'blog-details' ) );
     316            $this->assertFalse( wp_cache_get( $blog_id . 'short', 'blog-details' ) );
     317            $this->assertFalse( wp_cache_get( $key, 'blog-lookup' ) );
     318            $this->assertFalse( wp_cache_get( $key, 'blog-id-cache' ) );
    319319        }
    320320
     
    353353            // Update the blog count cache to use get_blog_count().
    354354            wp_update_network_counts();
    355             $this->assertEquals( 1, get_blog_count() );
     355            $this->assertSame( 1, get_blog_count() );
    356356        }
    357357
     
    367367            // Update the blog count cache to use get_blog_count().
    368368            wp_update_network_counts();
    369             $this->assertEquals( 1, get_blog_count() );
     369            $this->assertSame( 1, get_blog_count() );
    370370        }
    371371
     
    435435
    436436            // When the cache is primed with an invalid site, the value is set to -1.
    437             $this->assertEquals( -1, wp_cache_get( $blog_id, 'blog-details' ) );
     437            $this->assertSame( -1, wp_cache_get( $blog_id, 'blog-details' ) );
    438438
    439439            // Create a site in the invalid site's place.
     
    454454        function test_update_blog_status() {
    455455            $result = update_blog_status( 1, 'spam', 0 );
    456             $this->assertEquals( 0, $result );
     456            $this->assertSame( 0, $result );
    457457        }
    458458
     
    462462        function test_update_blog_status_invalid_status() {
    463463            $result = update_blog_status( 1, 'doesnotexist', 'invalid' );
    464             $this->assertEquals( 'invalid', $result );
     464            $this->assertSame( 'invalid', $result );
    465465        }
    466466
     
    476476            $blog = get_site( $blog_id );
    477477
    478             $this->assertEquals( '0', $blog->spam );
    479             $this->assertEquals( 1, $test_action_counter );
     478            $this->assertSame( '0', $blog->spam );
     479            $this->assertSame( 1, $test_action_counter );
    480480
    481481            // The action should not fire if the status of 'spam' stays the same.
     
    483483            $blog = get_site( $blog_id );
    484484
    485             $this->assertEquals( '0', $blog->spam );
    486             $this->assertEquals( 1, $test_action_counter );
     485            $this->assertSame( '0', $blog->spam );
     486            $this->assertSame( 1, $test_action_counter );
    487487
    488488            remove_action( 'make_ham_blog', array( $this, '_action_counter_cb' ), 10 );
     
    499499            $blog = get_site( $blog_id );
    500500
    501             $this->assertEquals( '1', $blog->spam );
    502             $this->assertEquals( 1, $test_action_counter );
     501            $this->assertSame( '1', $blog->spam );
     502            $this->assertSame( 1, $test_action_counter );
    503503
    504504            // The action should not fire if the status of 'spam' stays the same.
     
    506506            $blog = get_site( $blog_id );
    507507
    508             $this->assertEquals( '1', $blog->spam );
    509             $this->assertEquals( 1, $test_action_counter );
     508            $this->assertSame( '1', $blog->spam );
     509            $this->assertSame( 1, $test_action_counter );
    510510
    511511            remove_action( 'make_spam_blog', array( $this, '_action_counter_cb' ), 10 );
     
    522522            $blog = get_site( $blog_id );
    523523
    524             $this->assertEquals( '1', $blog->archived );
    525             $this->assertEquals( 1, $test_action_counter );
     524            $this->assertSame( '1', $blog->archived );
     525            $this->assertSame( 1, $test_action_counter );
    526526
    527527            // The action should not fire if the status of 'archived' stays the same.
     
    529529            $blog = get_site( $blog_id );
    530530
    531             $this->assertEquals( '1', $blog->archived );
    532             $this->assertEquals( 1, $test_action_counter );
     531            $this->assertSame( '1', $blog->archived );
     532            $this->assertSame( 1, $test_action_counter );
    533533
    534534            remove_action( 'archive_blog', array( $this, '_action_counter_cb' ), 10 );
     
    546546            $blog = get_site( $blog_id );
    547547
    548             $this->assertEquals( '0', $blog->archived );
    549             $this->assertEquals( 1, $test_action_counter );
     548            $this->assertSame( '0', $blog->archived );
     549            $this->assertSame( 1, $test_action_counter );
    550550
    551551            // The action should not fire if the status of 'archived' stays the same.
    552552            update_blog_status( $blog_id, 'archived', 0 );
    553553            $blog = get_site( $blog_id );
    554             $this->assertEquals( '0', $blog->archived );
    555             $this->assertEquals( 1, $test_action_counter );
     554            $this->assertSame( '0', $blog->archived );
     555            $this->assertSame( 1, $test_action_counter );
    556556
    557557            remove_action( 'unarchive_blog', array( $this, '_action_counter_cb' ), 10 );
     
    568568            $blog = get_site( $blog_id );
    569569
    570             $this->assertEquals( '1', $blog->deleted );
    571             $this->assertEquals( 1, $test_action_counter );
     570            $this->assertSame( '1', $blog->deleted );
     571            $this->assertSame( 1, $test_action_counter );
    572572
    573573            // The action should not fire if the status of 'deleted' stays the same.
     
    575575            $blog = get_site( $blog_id );
    576576
    577             $this->assertEquals( '1', $blog->deleted );
    578             $this->assertEquals( 1, $test_action_counter );
     577            $this->assertSame( '1', $blog->deleted );
     578            $this->assertSame( 1, $test_action_counter );
    579579
    580580            remove_action( 'make_delete_blog', array( $this, '_action_counter_cb' ), 10 );
     
    592592            $blog = get_site( $blog_id );
    593593
    594             $this->assertEquals( '0', $blog->deleted );
    595             $this->assertEquals( 1, $test_action_counter );
     594            $this->assertSame( '0', $blog->deleted );
     595            $this->assertSame( 1, $test_action_counter );
    596596
    597597            // The action should not fire if the status of 'deleted' stays the same.
     
    599599            $blog = get_site( $blog_id );
    600600
    601             $this->assertEquals( '0', $blog->deleted );
    602             $this->assertEquals( 1, $test_action_counter );
     601            $this->assertSame( '0', $blog->deleted );
     602            $this->assertSame( 1, $test_action_counter );
    603603
    604604            remove_action( 'make_undelete_blog', array( $this, '_action_counter_cb' ), 10 );
     
    615615            $blog = get_site( $blog_id );
    616616
    617             $this->assertEquals( '1', $blog->mature );
    618             $this->assertEquals( 1, $test_action_counter );
     617            $this->assertSame( '1', $blog->mature );
     618            $this->assertSame( 1, $test_action_counter );
    619619
    620620            // The action should not fire if the status of 'mature' stays the same.
     
    622622            $blog = get_site( $blog_id );
    623623
    624             $this->assertEquals( '1', $blog->mature );
    625             $this->assertEquals( 1, $test_action_counter );
     624            $this->assertSame( '1', $blog->mature );
     625            $this->assertSame( 1, $test_action_counter );
    626626
    627627            remove_action( 'mature_blog', array( $this, '_action_counter_cb' ), 10 );
     
    639639
    640640            $blog = get_site( $blog_id );
    641             $this->assertEquals( '0', $blog->mature );
    642             $this->assertEquals( 1, $test_action_counter );
     641            $this->assertSame( '0', $blog->mature );
     642            $this->assertSame( 1, $test_action_counter );
    643643
    644644            // The action should not fire if the status of 'mature' stays the same.
     
    646646            $blog = get_site( $blog_id );
    647647
    648             $this->assertEquals( '0', $blog->mature );
    649             $this->assertEquals( 1, $test_action_counter );
     648            $this->assertSame( '0', $blog->mature );
     649            $this->assertSame( 1, $test_action_counter );
    650650
    651651            remove_action( 'unmature_blog', array( $this, '_action_counter_cb' ), 10 );
     
    662662
    663663            $blog = get_site( $blog_id );
    664             $this->assertEquals( '0', $blog->public );
    665             $this->assertEquals( 1, $test_action_counter );
     664            $this->assertSame( '0', $blog->public );
     665            $this->assertSame( 1, $test_action_counter );
    666666
    667667            // The action should not fire if the status of 'mature' stays the same.
     
    669669            $blog = get_site( $blog_id );
    670670
    671             $this->assertEquals( '0', $blog->public );
    672             $this->assertEquals( 1, $test_action_counter );
     671            $this->assertSame( '0', $blog->public );
     672            $this->assertSame( 1, $test_action_counter );
    673673
    674674            remove_action( 'update_blog_public', array( $this, '_action_counter_cb' ), 10 );
     
    681681            self::factory()->post->create();
    682682            $post2 = self::factory()->post->create();
    683             $this->assertEquals( 2, get_site()->post_count );
     683            $this->assertSame( 2, get_site()->post_count );
    684684
    685685            wp_delete_post( $post2 );
    686             $this->assertEquals( 1, get_site()->post_count );
     686            $this->assertSame( 1, get_site()->post_count );
    687687        }
    688688
     
    693693            update_option( 'blogname', 'foo' );
    694694            $details = get_site( get_current_blog_id() );
    695             $this->assertEquals( 'foo', $details->blogname );
     695            $this->assertSame( 'foo', $details->blogname );
    696696
    697697            update_option( 'blogname', 'bar' );
    698698            $details = get_site( get_current_blog_id() );
    699             $this->assertEquals( 'bar', $details->blogname );
     699            $this->assertSame( 'bar', $details->blogname );
    700700        }
    701701
     
    710710
    711711            // Test the original response and cached response for the newly created site.
    712             $this->assertEquals( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
    713             $this->assertEquals( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) );
     712            $this->assertSame( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
     713            $this->assertSame( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) );
    714714        }
    715715
     
    726726            $details = get_site( $blog_id );
    727727
    728             $this->assertEquals( $blog_id, get_blog_id_from_url( strtoupper( $details->domain ), strtoupper( $details->path ) ) );
     728            $this->assertSame( $blog_id, get_blog_id_from_url( strtoupper( $details->domain ), strtoupper( $details->path ) ) );
    729729        }
    730730
     
    736736            $details = get_site( $blog_id );
    737737
    738             $this->assertEquals( 0, get_blog_id_from_url( $details->domain, 'foo' ) );
    739             $this->assertEquals( -1, wp_cache_get( md5( $details->domain . 'foo' ), 'blog-id-cache' ) );
     738            $this->assertSame( 0, get_blog_id_from_url( $details->domain, 'foo' ) );
     739            $this->assertSame( -1, wp_cache_get( md5( $details->domain . 'foo' ), 'blog-id-cache' ) );
    740740        }
    741741
     
    750750            wpmu_delete_blog( $blog_id );
    751751
    752             $this->assertEquals( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
    753             $this->assertEquals( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) );
     752            $this->assertSame( $blog_id, get_blog_id_from_url( $details->domain, $details->path ) );
     753            $this->assertSame( $blog_id, wp_cache_get( $key, 'blog-id-cache' ) );
    754754        }
    755755
     
    764764            wpmu_delete_blog( $blog_id, true );
    765765
    766             $this->assertEquals( false, wp_cache_get( $key, 'blog-id-cache' ) );
    767             $this->assertEquals( 0, get_blog_id_from_url( $details->domain, $details->path ) );
    768             $this->assertEquals( -1, wp_cache_get( $key, 'blog-id-cache' ) );
     766            $this->assertFalse( wp_cache_get( $key, 'blog-id-cache' ) );
     767            $this->assertSame( 0, get_blog_id_from_url( $details->domain, $details->path ) );
     768            $this->assertSame( -1, wp_cache_get( $key, 'blog-id-cache' ) );
    769769        }
    770770
     
    811811
    812812            $info = wp_upload_dir();
    813             $this->assertEquals( 'http://' . $site->domain . '/wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['url'] );
    814             $this->assertEquals( ABSPATH . 'wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['path'] );
    815             $this->assertEquals( gmstrftime( '/%Y/%m' ), $info['subdir'] );
    816             $this->assertEquals( '', $info['error'] );
     813            $this->assertSame( 'http://' . $site->domain . '/wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['url'] );
     814            $this->assertSame( ABSPATH . 'wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['path'] );
     815            $this->assertSame( gmstrftime( '/%Y/%m' ), $info['subdir'] );
     816            $this->assertFalse( $info['error'] );
    817817
    818818            $blog_id = self::factory()->blog->create();
     
    820820            switch_to_blog( $blog_id );
    821821            $info = wp_upload_dir();
    822             $this->assertEquals( 'http://' . $site->domain . '/wp-content/uploads/sites/' . get_current_blog_id() . '/' . gmstrftime( '%Y/%m' ), $info['url'] );
    823             $this->assertEquals( ABSPATH . 'wp-content/uploads/sites/' . get_current_blog_id() . '/' . gmstrftime( '%Y/%m' ), $info['path'] );
    824             $this->assertEquals( gmstrftime( '/%Y/%m' ), $info['subdir'] );
    825             $this->assertEquals( '', $info['error'] );
     822            $this->assertSame( 'http://' . $site->domain . '/wp-content/uploads/sites/' . get_current_blog_id() . '/' . gmstrftime( '%Y/%m' ), $info['url'] );
     823            $this->assertSame( ABSPATH . 'wp-content/uploads/sites/' . get_current_blog_id() . '/' . gmstrftime( '%Y/%m' ), $info['path'] );
     824            $this->assertSame( gmstrftime( '/%Y/%m' ), $info['subdir'] );
     825            $this->assertFalse( $info['error'] );
    826826            restore_current_blog();
    827827
    828828            $info = wp_upload_dir();
    829             $this->assertEquals( 'http://' . $site->domain . '/wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['url'] );
    830             $this->assertEquals( ABSPATH . 'wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['path'] );
    831             $this->assertEquals( gmstrftime( '/%Y/%m' ), $info['subdir'] );
    832             $this->assertEquals( '', $info['error'] );
     829            $this->assertSame( 'http://' . $site->domain . '/wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['url'] );
     830            $this->assertSame( ABSPATH . 'wp-content/uploads/' . gmstrftime( '%Y/%m' ), $info['path'] );
     831            $this->assertSame( gmstrftime( '/%Y/%m' ), $info['subdir'] );
     832            $this->assertFalse( $info['error'] );
    833833        }
    834834
     
    880880            $details = get_site( 1 );
    881881
    882             $this->assertEquals( 1, domain_exists( $details->domain, $details->path ) );
     882            $this->assertSame( 1, domain_exists( $details->domain, $details->path ) );
    883883        }
    884884
     
    886886            $details = get_site( 1 );
    887887
    888             $this->assertEquals( 1, domain_exists( $details->domain, $details->path, $details->site_id ) );
     888            $this->assertSame( 1, domain_exists( $details->domain, $details->path, $details->site_id ) );
    889889        }
    890890
     
    896896            $details = get_site( 1 );
    897897
    898             $this->assertEquals( null, domain_exists( $details->domain, $details->path, 999 ) );
     898            $this->assertNull( domain_exists( $details->domain, $details->path, 999 ) );
    899899        }
    900900
    901901        function test_invalid_domain_does_not_exist_with_default_site_id() {
    902             $this->assertEquals( null, domain_exists( 'foo', 'bar' ) );
     902            $this->assertNull( domain_exists( 'foo', 'bar' ) );
    903903        }
    904904
     
    907907            $exists = domain_exists( 'foo', 'bar' );
    908908            remove_filter( 'domain_exists', array( $this, '_domain_exists_cb' ), 10, 4 );
    909             $this->assertEquals( 1234, $exists );
     909            $this->assertSame( 1234, $exists );
    910910        }
    911911
     
    921921
    922922            // Make sure the same result is returned with or without a trailing slash.
    923             $this->assertEquals( $exists1, $exists2 );
     923            $this->assertSame( $exists1, $exists2 );
    924924        }
    925925
     
    929929        function test_get_blogaddress_by_id_with_valid_id() {
    930930            $blogaddress = get_blogaddress_by_id( 1 );
    931             $this->assertEquals( 'http://' . WP_TESTS_DOMAIN . '/', $blogaddress );
     931            $this->assertSame( 'http://' . WP_TESTS_DOMAIN . '/', $blogaddress );
    932932        }
    933933
     
    937937        function test_get_blogaddress_by_id_with_invalid_id() {
    938938            $blogaddress = get_blogaddress_by_id( 42 );
    939             $this->assertEquals( '', $blogaddress );
     939            $this->assertSame( '', $blogaddress );
    940940        }
    941941
     
    11811181
    11821182            clean_blog_cache( $site );
    1183             $this->assertEquals( $old_count + 1, did_action( 'clean_site_cache' ) );
     1183            $this->assertSame( $old_count + 1, did_action( 'clean_site_cache' ) );
    11841184        }
    11851185
     
    11951195            clean_blog_cache( $site );
    11961196            wp_suspend_cache_invalidation( $suspend );
    1197             $this->assertEquals( $old_count, did_action( 'clean_site_cache' ) );
     1197            $this->assertSame( $old_count, did_action( 'clean_site_cache' ) );
    11981198        }
    11991199
     
    12051205
    12061206            clean_blog_cache( null );
    1207             $this->assertEquals( $old_count, did_action( 'clean_site_cache' ) );
     1207            $this->assertSame( $old_count, did_action( 'clean_site_cache' ) );
    12081208        }
    12091209
     
    12151215
    12161216            clean_blog_cache( 'something' );
    1217             $this->assertEquals( $old_count, did_action( 'clean_site_cache' ) );
     1217            $this->assertSame( $old_count, did_action( 'clean_site_cache' ) );
    12181218        }
    12191219
     
    14441444                    $this->assertTrue( $old_site->last_updated <= $value );
    14451445                } else {
    1446                     $this->assertEquals( $old_site->$key, $value );
     1446                    $this->assertSame( $old_site->$key, $value );
    14471447                }
    14481448            }
     
    15411541
    15421542            $this->assertInstanceOf( 'WP_Site', $result );
    1543             $this->assertEquals( $result->to_array(), $site->to_array() );
     1543            $this->assertSame( $result->to_array(), $site->to_array() );
    15441544        }
    15451545
     
    21172117            $this->assertTrue( $result );
    21182118            $this->assertTrue( $initialized );
    2119             $this->assertEquals( $expected_options, $options );
    2120             $this->assertEquals( $expected_meta, $meta );
     2119            $this->assertSame( $expected_options, $options );
     2120            $this->assertSame( $expected_meta, $meta );
    21212121        }
    21222122
     
    22152215            $this->assertTrue( $result );
    22162216            $this->assertTrue( $user_is_admin );
    2217             $this->assertEquals( get_userdata( 1 )->user_email, $admin_email );
     2217            $this->assertSame( get_userdata( 1 )->user_email, $admin_email );
    22182218        }
    22192219
     
    23712371            // Should not hit blog_details cache initialised in $this->populate_options_callback tirggered during
    23722372            // populate_options callback's call of get_blog_details.
    2373             $this->assertEquals( 'http://testsite1.example.org/test', get_blog_details( $blog_id )->siteurl );
    2374             $this->assertEquals( 'http://testsite1.example.org/test', get_site( $blog_id )->siteurl );
     2373            $this->assertSame( 'http://testsite1.example.org/test', get_blog_details( $blog_id )->siteurl );
     2374            $this->assertSame( 'http://testsite1.example.org/test', get_site( $blog_id )->siteurl );
    23752375
    23762376            remove_action( 'populate_options', array( $this, 'populate_options_callback' ) );
Note: See TracChangeset for help on using the changeset viewer.