Changeset 47329 for branches/3.9/tests/phpunit/tests/canonical.php
- Timestamp:
- 02/20/2020 05:04:42 PM (5 years ago)
- Location:
- branches/3.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.9
-
branches/3.9/tests/phpunit/tests/canonical.php
r32149 r47329 20 20 21 21 function setUp() { 22 global $wp_rewrite; 23 22 24 parent::setUp(); 23 25 … … 26 28 update_option( 'posts_per_page', 5 ); 27 29 28 update_option( 'permalink_structure', $this->structure ); 30 $wp_rewrite->init(); 31 $wp_rewrite->set_permalink_structure( $this->structure ); 32 29 33 create_initial_taxonomies(); 30 $GLOBALS['wp_rewrite']->init(); 31 flush_rewrite_rules();34 35 $wp_rewrite->flush_rules(); 32 36 33 37 $this->old_current_user = get_current_user_id(); … … 81 85 82 86 function tearDown() { 87 global $wp_rewrite; 83 88 wp_set_current_user( $this->old_current_user ); 84 89 85 $ GLOBALS['wp_rewrite']->init();90 $wp_rewrite->init(); 86 91 parent::tearDown(); 87 92 } … … 176 181 array( '/category/uncategorized/?paged=2', array( 'url' => '/category/uncategorized/page/2/', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2) ) ), 177 182 array( '/category/uncategorized/?paged=2&category_name=uncategorized', array( 'url' => '/category/uncategorized/page/2/', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2) ), 17174 ), 178 array( '/category/child-1/', '/category/parent/child-1/', 18734 ),179 array( '/category/foo/child-1/', '/category/parent/child-1/', 18734 ),180 183 181 184 // Categories & Intersections with other vars … … 187 190 188 191 // Categories with Dates 189 array( '/category/uncategorized/?paged=2&year=2008', array( 'url' => '/category/uncategorized/page/2/?year=2008', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2, 'year' => 2008) ), 17661 ), 190 // array( '/2008/04/?cat=1', array( 'url' => '/2008/04/?cat=1', 'qv' => array('cat' => '1', 'year' => '2008', 'monthnum' => '04' ) ), 17661 ), 191 array( '/2008/04/?cat=1', array( 'url' => '/category/uncategorized/?year=2008&monthnum=04', 'qv' => array('category_name' => 'uncategorized', 'year' => '2008', 'monthnum' => '04' ) ), 17661 ), 192 array( '/2008/04/?cat=1', array( 'url' => '/2008/04/?cat=1', 'qv' => array('cat' => '1', 'year' => '2008', 'monthnum' => '04' ) ), 17661 ), 192 193 // array( '/2008/?category_name=cat-a', array( 'url' => '/2008/?category_name=cat-a', 'qv' => array('category_name' => 'cat-a', 'year' => '2008' ) ) ), 193 array( '/2008/?category_name=cat-a', array( 'url' => '/category/cat-a/?year=2008', 'qv' => array('category_name' => 'cat-a', 'year' => '2008' ) ), 20386 ),194 // array( '/category/uncategorized/?year=2008', array( 'url' => '/2008/?category_name=uncategorized', 'qv' => array('category_name' => 'uncategorized', 'year' => '2008' ) ), 17661 ),195 array( '/category/uncategorized/?year=2008', array( 'url' => '/category/uncategorized/?year=2008', 'qv' => array('category_name' => 'uncategorized', 'year' => '2008' ) ), 17661 ),196 194 197 195 // Pages 198 array( '/sample%20page/', array( 'url' => '/sample-page/', 'qv' => array('pagename' => 'sample-page', 'page' => '' ) ), 17653 ), // Page rules always set 'page'199 array( '/sample------page/', array( 'url' => '/sample-page/', 'qv' => array('pagename' => 'sample-page', 'page' => '' ) ), 14773 ),200 196 array( '/child-page-1/', '/parent-page/child-page-1/'), 201 197 array( '/?page_id=144', '/parent-page/child-page-1/'), … … 217 213 218 214 array( '/2008/09/03/images-test/3/', array( 'url' => '/2008/09/03/images-test/3/', 'qv' => array( 'name' => 'images-test', 'year' => '2008', 'monthnum' => '09', 'day' => '03', 'page' => '/3' ) ) ), // page = /3 ?! 219 array( '/2008/09/03/images-test/8/', '/2008/09/03/images-test/4/', 11694 ), // post with 4 pages220 215 array( '/2008/09/03/images-test/?page=3', '/2008/09/03/images-test/3/' ), 221 216 array( '/2008/09/03/images-te?page=3', '/2008/09/03/images-test/3/' ), … … 223 218 // Comments 224 219 array( '/2008/03/03/comment-test/?cpage=2', '/2008/03/03/comment-test/comment-page-2/' ), 225 array( '/2008/03/03/comment-test/comment-page-20/', '/2008/03/03/comment-test/comment-page-3/', 20388 ), // there's only 3 pages226 array( '/2008/03/03/comment-test/?cpage=30', '/2008/03/03/comment-test/comment-page-3/', 20388 ), // there's only 3 pages227 220 228 221 // Attachments … … 247 240 array( '/?author=%d', '/author/canonical-author/' ), 248 241 // array( '/?author=%d&year=2008', '/2008/?author=3'), 249 array( '/?author=%d&year=2008', '/author/canonical-author/?year=2008', 17661 ),250 242 // array( '/author/canonical-author/?year=2008', '/2008/?author=3'), //Either or, see previous testcase. 251 array( '/author/canonical-author/?year=2008', '/author/canonical-author/?year=2008', 17661 ),252 243 253 244 // Feeds
Note: See TracChangeset
for help on using the changeset viewer.