Make WordPress Core

Changeset 51857


Ignore:
Timestamp:
09/23/2021 09:29:07 PM (3 years ago)
Author:
hellofromTonya
Message:

Build/Test Tools: Upgrades Tests_Multisite_MS_Permalink_Collision fixture methods and strict assertion.

Improvements include:

  • Upgrades the test fixture methods to the new snake_case methods.
  • Reorders the fixture methods for consistency.
  • Uses strict assertions of assertSame and assertNotSame.

Follow-up to [51855-51856].

Props hellofromTonya.
See #51147.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/multisite/msPermalinkCollision.php

    r51856 r51857  
    4444        }
    4545
    46         public function setUp() {
    47             global $wpdb;
    48             parent::setUp();
    49             $this->suppress = $wpdb->suppress_errors();
    50         }
    51 
    52         public function tearDown() {
    53             global $wpdb;
    54             $wpdb->suppress_errors( $this->suppress );
    55             parent::tearDown();
    56         }
    57 
    5846        /**
    5947         * Delete blog and pages we created.
     
    6654        }
    6755
     56        public function set_up() {
     57            global $wpdb;
     58            parent::set_up();
     59            $this->suppress = $wpdb->suppress_errors();
     60        }
     61
     62        public function tear_down() {
     63            global $wpdb;
     64            $wpdb->suppress_errors( $this->suppress );
     65            parent::tear_down();
     66        }
     67
    6868        public function test_avoid_blog_page_permalink_collision_renames_post_name() {
    69             $this->assertNotEquals( self::$post_and_blog_path, self::$root_page->post_name );
     69            $this->assertNotSame( self::$post_and_blog_path, self::$root_page->post_name );
    7070        }
    7171
     
    7676         */
    7777        public function test_avoid_blog_page_permalink_collision_doesnt_rename_child_pages() {
    78             $this->assertEquals( self::$post_and_blog_path, self::$child_page->post_name );
     78            $this->assertSame( self::$post_and_blog_path, self::$child_page->post_name );
    7979        }
    8080    }
Note: See TracChangeset for help on using the changeset viewer.