Changeset 34802 for trunk/tests/phpunit/tests/term/getTermLink.php
- Timestamp:
- 10/03/2015 05:14:12 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/term/getTermLink.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/getTermLink.php
r33022 r34802 5 5 */ 6 6 class Tests_Term_GetTermLink extends WP_UnitTestCase { 7 private $permalink_structure;8 7 9 8 public function setUp() { 10 9 parent::setUp(); 11 10 12 // Assume no pretty permalinks.13 global $wp_rewrite;14 $this->permalink_structure = get_option( 'permalink_structure' );15 $wp_rewrite->set_permalink_structure( '' );16 $wp_rewrite->flush_rules();17 18 11 register_taxonomy( 'wptests_tax', 'post' ); 19 }20 21 public function tearDown() {22 global $wp_rewrite;23 $wp_rewrite->set_permalink_structure( $this->permalink_structure );24 $wp_rewrite->flush_rules();25 26 parent::tearDown();27 12 } 28 13 … … 102 87 public function test_taxonomy_permastruct_with_hierarchical_rewrite_should_put_term_ancestors_in_link() { 103 88 global $wp_rewrite; 104 $ permalink_structure = get_option( 'permalink_structure');89 $wp_rewrite->init(); 105 90 $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); 106 91 $wp_rewrite->flush_rules(); … … 126 111 127 112 $actual = get_term_link( $t2, 'wptests_tax2' ); 128 129 $wp_rewrite->set_permalink_structure( $permalink_structure );130 $wp_rewrite->flush_rules();131 113 132 114 $this->assertContains( '/foo/term1/term2/', $actual ); … … 160 142 $actual = get_term_link( $t2, 'wptests_tax2' ); 161 143 162 $wp_rewrite->set_permalink_structure( $permalink_structure );163 $wp_rewrite->flush_rules();164 165 144 $this->assertContains( '/foo/term2/', $actual ); 166 145 }
Note: See TracChangeset
for help on using the changeset viewer.