Changeset 47338 for branches/3.8/tests/phpunit/tests/link.php
- Timestamp:
- 02/21/2020 01:05:39 PM (5 years ago)
- Location:
- branches/3.8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.8
- Property svn:mergeinfo changed
-
branches/3.8/tests/phpunit/tests/link.php
r25959 r47338 4 4 */ 5 5 class Tests_Link extends WP_UnitTestCase { 6 7 function tearDown() { 8 global $wp_rewrite; 9 $wp_rewrite->init(); 10 parent::tearDown(); 11 } 6 12 7 13 function _get_pagenum_link_cb( $url ) { … … 30 36 31 37 function test_wp_get_shortlink() { 38 global $wp_rewrite; 39 32 40 $post_id = $this->factory->post->create(); 33 41 $post_id2 = $this->factory->post->create(); 42 43 $wp_rewrite->init(); 44 $wp_rewrite->set_permalink_structure( '' ); 45 $wp_rewrite->flush_rules(); 34 46 35 47 // Basic case … … 60 72 $this->assertEquals( '', wp_get_shortlink() ); 61 73 62 global $wp_rewrite;63 $wp_rewrite->permalink_structure = '';64 74 $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); 65 75 $wp_rewrite->flush_rules(); … … 74 84 $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( 0 ) ); 75 85 $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink() ); 76 77 $wp_rewrite->set_permalink_structure( '' );78 $wp_rewrite->flush_rules();79 86 } 80 87 … … 87 94 88 95 global $wp_rewrite; 89 $wp_rewrite->permalink_structure = '';90 96 $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); 91 97 $wp_rewrite->flush_rules(); 92 98 93 99 $this->assertEquals( home_url( '?p=' . $post_id ), wp_get_shortlink( $post_id, 'post' ) ); 94 95 $wp_rewrite->set_permalink_structure( '' );96 $wp_rewrite->flush_rules();97 100 } 98 101
Note: See TracChangeset
for help on using the changeset viewer.