Make WordPress Core

Changeset 51859


Ignore:
Timestamp:
09/24/2021 12:29:46 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Tests: Further improve the tests for avoid_blog_page_permalink_collision():

  • Rename the test filename and class to match the name of the function being tested.
  • Remove unnecessary setUp() and tearDown() methods.
  • Replace the only test group with post.

Follow-up to [51855-51857].

See #51147.

File:
1 moved

Legend:

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

    r51858 r51859  
    77     *
    88     * @group multisite
    9      * @group only
     9     * @group post
    1010     */
    11     class Tests_Multisite_MS_Permalink_Collision extends WP_UnitTestCase {
    12         protected $suppress = false;
     11    class Tests_Multisite_AvoidBlogPagePermalinkCollision extends WP_UnitTestCase {
    1312        protected static $site_id;
    1413        protected static $root_page;
     
    5453        }
    5554
    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 
    6855        public function test_avoid_blog_page_permalink_collision_renames_post_name() {
    6956            $this->assertNotSame( self::$post_and_blog_path, self::$root_page->post_name );
     
    7158
    7259        /**
    73          * Ensure `avoid_blog_page_permalink_collision()` doesn't rename child pages post_name.
     60         * Ensure `avoid_blog_page_permalink_collision()` doesn't rename child pages' post_name.
    7461         *
    7562         * @ticket 51147
Note: See TracChangeset for help on using the changeset viewer.