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.

git-svn-id: https://develop.svn.wordpress.org/trunk@51857 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Tonya Mork 2021-09-23 21:29:07 +00:00
parent bf705d99e6
commit 3f6ba8aeb3

View File

@ -43,18 +43,6 @@ if ( is_multisite() ) :
);
}
public function setUp() {
global $wpdb;
parent::setUp();
$this->suppress = $wpdb->suppress_errors();
}
public function tearDown() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
parent::tearDown();
}
/**
* Delete blog and pages we created.
*/
@ -65,8 +53,20 @@ if ( is_multisite() ) :
wp_delete_post( self::$child_page->ID );
}
public function set_up() {
global $wpdb;
parent::set_up();
$this->suppress = $wpdb->suppress_errors();
}
public function tear_down() {
global $wpdb;
$wpdb->suppress_errors( $this->suppress );
parent::tear_down();
}
public function test_avoid_blog_page_permalink_collision_renames_post_name() {
$this->assertNotEquals( self::$post_and_blog_path, self::$root_page->post_name );
$this->assertNotSame( self::$post_and_blog_path, self::$root_page->post_name );
}
/**
@ -75,7 +75,7 @@ if ( is_multisite() ) :
* @ticket 51147
*/
public function test_avoid_blog_page_permalink_collision_doesnt_rename_child_pages() {
$this->assertEquals( self::$post_and_blog_path, self::$child_page->post_name );
$this->assertSame( self::$post_and_blog_path, self::$child_page->post_name );
}
}