Make WordPress Core


Ignore:
Timestamp:
10/03/2015 05:14:12 PM (9 years ago)
Author:
DrewAPicture
Message:

Tests: Introduce WP_UnitTestCase::reset_permalinks(), an attempt to DRY up logic for resetting and restoring default permalinks on setUp() and tearDown().

See #33968.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rewrite/numericSlugs.php

    r32648 r34802  
    4848
    4949        $this->assertQueryTrue( 'is_single', 'is_singular' );
    50 
    51         $wp_rewrite->set_permalink_structure('');
    5250    }
    5351
     
    7876
    7977        $this->assertEquals( '2015', url_to_postid( get_permalink( '2015' ) ) );
    80 
    81         $wp_rewrite->set_permalink_structure('');
    8278    }
    8379
     
    9995
    10096        $this->assertQueryTrue( 'is_single', 'is_singular' );
    101 
    102         $wp_rewrite->set_permalink_structure('');
    10397    }
    10498
     
    118112
    119113        $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
    120 
    121         $wp_rewrite->set_permalink_structure('');
    122114    }
    123115
     
    140132
    141133        $this->assertQueryTrue( 'is_single', 'is_singular' );
    142 
    143         $wp_rewrite->set_permalink_structure('');
    144134    }
    145135
     
    160150
    161151        $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
    162 
    163         $wp_rewrite->set_permalink_structure('');
    164152    }
    165153
     
    182170
    183171        $this->assertQueryTrue( 'is_single', 'is_singular' );
    184 
    185         $wp_rewrite->set_permalink_structure('');
    186172    }
    187173
     
    202188
    203189        $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
    204 
    205         $wp_rewrite->set_permalink_structure('');
    206190    }
    207191
     
    223207
    224208        $this->assertQueryTrue( 'is_single', 'is_singular' );
    225 
    226         $wp_rewrite->set_permalink_structure('');
    227209    }
    228210
     
    242224
    243225        $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
    244 
    245         $wp_rewrite->set_permalink_structure('');
    246226    }
    247227
     
    263243
    264244        $this->assertQueryTrue( 'is_single', 'is_singular' );
    265 
    266         $wp_rewrite->set_permalink_structure('');
    267245    }
    268246
     
    282260
    283261        $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
    284 
    285         $wp_rewrite->set_permalink_structure('');
    286262    }
    287263
     
    304280
    305281        $this->assertQueryTrue( 'is_single', 'is_singular' );
    306 
    307         $wp_rewrite->set_permalink_structure('');
    308282    }
    309283
     
    324298
    325299        $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
    326 
    327         $wp_rewrite->set_permalink_structure('');
    328300    }
    329301
     
    345317
    346318        $this->assertQueryTrue( 'is_single', 'is_singular' );
    347 
    348         $wp_rewrite->set_permalink_structure('');
    349319    }
    350320
     
    364334
    365335        $this->assertEquals( $id, url_to_postid( get_permalink( $id ) ) );
    366 
    367         $wp_rewrite->set_permalink_structure('');
    368336    }
    369337
     
    390358        $this->assertTrue( $q->is_day );
    391359        $this->assertFalse( $q->is_single );
    392 
    393         $wp_rewrite->set_permalink_structure('');
    394360    }
    395361
Note: See TracChangeset for help on using the changeset viewer.