Changeset 34807
- Timestamp:
- 10/03/2015 07:26:24 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase.php
r34803 r34807 16 16 17 17 protected $db_version; 18 19 public static $default_permalink_structure;20 18 21 19 /** … … 42 40 $this->factory = new WP_UnitTest_Factory; 43 41 $this->clean_up_global_scope(); 44 45 self::$default_permalink_structure = get_option( 'permalink_structure' );46 42 47 43 /* … … 105 101 $this->_restore_hooks(); 106 102 wp_set_current_user( 0 ); 107 108 $this->reset_permalinks( $restore = true );109 103 } 110 104 … … 657 651 * Utility method that resets permalinks and flushes rewrites. 658 652 * 659 * Collects the current permalink structure and stores it in a class property for use660 * by sub-classes.661 *662 653 * @since 4.4.0 663 654 * 664 655 * @global WP_Rewrite $wp_rewrite 665 * 666 * @param bool $restore_default Optional. Whether to restore the default permalink structure. 667 * Default false. 668 */ 669 public function reset_permalinks( $restore_default = false ) { 656 */ 657 public function reset_permalinks() { 670 658 global $wp_rewrite; 671 659 672 if ( ! $restore_default ) { 673 $wp_rewrite->init(); 674 $wp_rewrite->set_permalink_structure( '' ); 675 } else { 676 $wp_rewrite->set_permalink_structure( self::$default_permalink_structure ); 677 } 678 660 $wp_rewrite->init(); 661 $wp_rewrite->set_permalink_structure( '' ); 679 662 $wp_rewrite->flush_rules(); 680 663 }
Note: See TracChangeset
for help on using the changeset viewer.