[wp-trac] [WordPress Trac] #35452: WP_UnitTestCase::set_permalink_structure() doesn't set all permastructures
WordPress Trac
noreply at wordpress.org
Thu Jan 14 02:12:30 UTC 2016
#35452: WP_UnitTestCase::set_permalink_structure() doesn't set all permastructures
------------------------------+-----------------------------
Reporter: johnbillion | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version:
Severity: normal | Keywords: needs-patch
Focuses: |
------------------------------+-----------------------------
Calling `$this->set_permalink_structure(
'/%year%/%monthnum%/%day%/%postname%/' )` from within a unit test does not
result in the `$wp_rewrite->extra_permastructs` property being populated.
The result is that categories and tags don't have pretty permalinks
enabled. Posts, date archives, author archives, custom post type archives
etc do have pretty permalinks enabled as expected.
Example failing test:
{{{
public function test_pretty_links() {
$this->set_permalink_structure(
'/%year%/%monthnum%/%day%/%postname%/' );
$term = self::factory()->term->create_and_get();
$expected = 'http://' . WP_TESTS_DOMAIN . '/tag/' . $term->slug .
'/';
$actual = get_term_link( $term );
$this->assertEquals( $expected, $actual );
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35452>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list