Make WordPress Core


Ignore:
Timestamp:
07/03/2014 01:42:57 AM (12 years ago)
Author:
wonderboymusic
Message:

Setup rewrite changes in tests in a predictable fashion. Don't mix method calls with wrapper function calls.

See #28706.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/link.php

    r28964 r28966  
    44 */
    55class Tests_Link extends WP_UnitTestCase {
     6
     7        function tearDown() {
     8                global $wp_rewrite;
     9                parent::tearDown();
     10                $wp_rewrite->init();
     11        }
    612
    713        function _get_pagenum_link_cb( $url ) {
    … …  
    6672                $this->assertEquals( '', wp_get_shortlink() );
    6773
    68                 $wp_rewrite->permalink_structure = '';
    6974                $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
    7075                $wp_rewrite->flush_rules();
    … …  
    7984                $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( 0 ) );
    8085                $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink() );
    81 
    82                 $wp_rewrite->set_permalink_structure( '' );
    83                 $wp_rewrite->flush_rules();
    8486        }
    8587
    … …  
    9294
    9395                global $wp_rewrite;
    94                 $wp_rewrite->permalink_structure = '';
    9596                $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );
    9697                $wp_rewrite->flush_rules();
    9798
    9899                $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( $post_id, 'post' ) );
    99 
    100                 $wp_rewrite->set_permalink_structure( '' );
    101                 $wp_rewrite->flush_rules();
    102100        }
    103101
    … …  
    118116
    119117                $this->assertEquals( home_url( '/' ), wp_get_shortlink( $post_id, 'post' ) );
    120 
    121                 $wp_rewrite->set_permalink_structure( '' );
    122                 $wp_rewrite->flush_rules();
    123118        }
    124119
Note: See TracChangeset for help on using the changeset viewer.