mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@34810 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -127,10 +127,7 @@ class Tests_User_Author_Template extends WP_UnitTestCase {
|
||||
* @ticket 30355
|
||||
*/
|
||||
public function test_get_the_author_posts_link_with_permalinks() {
|
||||
global $wp_rewrite;
|
||||
$wp_rewrite->init();
|
||||
$wp_rewrite->set_permalink_structure( '/%postname%/' );
|
||||
$wp_rewrite->flush_rules();
|
||||
$this->set_permalink_structure( '/%postname%/' );
|
||||
|
||||
$author = $this->factory->user->create_and_get( array(
|
||||
'display_name' => 'Foo',
|
||||
|
||||
Reference in New Issue
Block a user