Make WordPress Core


Ignore:
Timestamp:
10/03/2015 08:54:11 PM (9 years ago)
Author:
DrewAPicture
Message:

Tests: Permalink Structures Phase II: DRY up logic for setting permalink structures in test methods.

Renames reset_permalinks() to set_permalink_structure() (mimicking $wp_rewrite->set_permalink_structure()) and allows it to accept an optional permalink structure. In this way, we can double dip using it to both set and reset the permalink structure from anywhere.

Removes alot of duplicated code from tests.

See #33968.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/user/author.php

    r34802 r34810  
    128128     */
    129129    public function test_get_the_author_posts_link_with_permalinks() {
    130         global $wp_rewrite;
    131         $wp_rewrite->init();
    132         $wp_rewrite->set_permalink_structure( '/%postname%/' );
    133         $wp_rewrite->flush_rules();
     130        $this->set_permalink_structure( '/%postname%/' );
    134131
    135132        $author = $this->factory->user->create_and_get( array(
Note: See TracChangeset for help on using the changeset viewer.