From 3f6ba8aeb38269fba6b9adc60eac4220655f1179 Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Thu, 23 Sep 2021 21:29:07 +0000 Subject: [PATCH] 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 --- .../tests/multisite/msPermalinkCollision.php | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/phpunit/tests/multisite/msPermalinkCollision.php b/tests/phpunit/tests/multisite/msPermalinkCollision.php index 1471eb9e5e..794edab6a9 100644 --- a/tests/phpunit/tests/multisite/msPermalinkCollision.php +++ b/tests/phpunit/tests/multisite/msPermalinkCollision.php @@ -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 ); } }