Changeset 47343 for branches/3.7/tests/phpunit/tests/canonical.php
- Timestamp:
- 02/22/2020 12:05:12 PM (6 years ago)
- Location:
- branches/3.7
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tests/phpunit/tests/canonical.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.7
- Property svn:mergeinfo changed
-
branches/3.7/tests/phpunit/tests/canonical.php
r32151 r47343 20 20 21 21 function setUp() { 22 global $wp_rewrite; 23 22 24 parent::setUp(); 23 25 26 update_option( 'page_comments', true ); 24 27 update_option( 'comments_per_page', 5 ); 25 28 update_option( 'posts_per_page', 5 ); 26 29 27 update_option( 'permalink_structure', $this->structure ); 30 $wp_rewrite->init(); 31 $wp_rewrite->set_permalink_structure( $this->structure ); 32 28 33 create_initial_taxonomies(); 29 $GLOBALS['wp_rewrite']->init(); 30 flush_rewrite_rules();34 35 $wp_rewrite->flush_rules(); 31 36 32 37 $this->old_current_user = get_current_user_id(); … … 80 85 81 86 function tearDown() { 87 global $wp_rewrite; 82 88 wp_set_current_user( $this->old_current_user ); 83 89 84 $ GLOBALS['wp_rewrite']->init();90 $wp_rewrite->init(); 85 91 parent::tearDown(); 86 92 } … … 168 174 // Categories 169 175 170 array( '?cat=%d', '/category/parent/', 15256 ),171 array( '?cat=%d', '/category/parent/child-1/', 15256 ),172 176 array( '?cat=%d', '/category/parent/child-1/child-2/' ), // no children 173 177 array( '/category/uncategorized/', array( 'url' => '/category/uncategorized/', 'qv' => array( 'category_name' => 'uncategorized' ) ) ), … … 175 179 array( '/category/uncategorized/?paged=2', array( 'url' => '/category/uncategorized/page/2/', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2) ) ), 176 180 array( '/category/uncategorized/?paged=2&category_name=uncategorized', array( 'url' => '/category/uncategorized/page/2/', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2) ), 17174 ), 177 array( '/category/child-1/', '/category/parent/child-1/', 18734 ),178 array( '/category/foo/child-1/', '/category/parent/child-1/', 18734 ),179 181 180 182 // Categories & Intersections with other vars … … 186 188 187 189 // Categories with Dates 188 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 ), 189 // array( '/2008/04/?cat=1', array( 'url' => '/2008/04/?cat=1', 'qv' => array('cat' => '1', 'year' => '2008', 'monthnum' => '04' ) ), 17661 ), 190 array( '/2008/04/?cat=1', array( 'url' => '/category/uncategorized/?year=2008&monthnum=04', 'qv' => array('category_name' => 'uncategorized', 'year' => '2008', 'monthnum' => '04' ) ), 17661 ), 190 array( '/2008/04/?cat=1', array( 'url' => '/2008/04/?cat=1', 'qv' => array('cat' => '1', 'year' => '2008', 'monthnum' => '04' ) ), 17661 ), 191 191 // array( '/2008/?category_name=cat-a', array( 'url' => '/2008/?category_name=cat-a', 'qv' => array('category_name' => 'cat-a', 'year' => '2008' ) ) ), 192 array( '/2008/?category_name=cat-a', array( 'url' => '/category/cat-a/?year=2008', 'qv' => array('category_name' => 'cat-a', 'year' => '2008' ) ), 20386 ),193 // array( '/category/uncategorized/?year=2008', array( 'url' => '/2008/?category_name=uncategorized', 'qv' => array('category_name' => 'uncategorized', 'year' => '2008' ) ), 17661 ),194 array( '/category/uncategorized/?year=2008', array( 'url' => '/category/uncategorized/?year=2008', 'qv' => array('category_name' => 'uncategorized', 'year' => '2008' ) ), 17661 ),195 192 196 193 // Pages 197 array( '/sample%20page/', array( 'url' => '/sample-page/', 'qv' => array('pagename' => 'sample-page', 'page' => '' ) ), 17653 ), // Page rules always set 'page'198 array( '/sample------page/', array( 'url' => '/sample-page/', 'qv' => array('pagename' => 'sample-page', 'page' => '' ) ), 14773 ),199 194 array( '/child-page-1/', '/parent-page/child-page-1/'), 200 195 array( '/?page_id=144', '/parent-page/child-page-1/'), … … 216 211 217 212 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 ?! 218 array( '/2008/09/03/images-test/8/', '/2008/09/03/images-test/4/', 11694 ), // post with 4 pages219 213 array( '/2008/09/03/images-test/?page=3', '/2008/09/03/images-test/3/' ), 220 214 array( '/2008/09/03/images-te?page=3', '/2008/09/03/images-test/3/' ), 221 215 222 216 // Comments 223 array( '/2008/03/03/comment-test/?cpage=2', '/2008/03/03/comment-test/comment-page-2/', 20388 ), 224 array( '/2008/03/03/comment-test/comment-page-20/', '/2008/03/03/comment-test/comment-page-3/', 20388 ), // there's only 3 pages 225 array( '/2008/03/03/comment-test/?cpage=30', '/2008/03/03/comment-test/comment-page-3/', 20388 ), // there's only 3 pages 217 array( '/2008/03/03/comment-test/?cpage=2', '/2008/03/03/comment-test/comment-page-2/' ), 226 218 227 219 // Attachments … … 246 238 array( '/?author=%d', '/author/canonical-author/' ), 247 239 // array( '/?author=%d&year=2008', '/2008/?author=3'), 248 array( '/?author=%d&year=2008', '/author/canonical-author/?year=2008', 17661 ),249 240 // array( '/author/canonical-author/?year=2008', '/2008/?author=3'), //Either or, see previous testcase. 250 array( '/author/canonical-author/?year=2008', '/author/canonical-author/?year=2008', 17661 ),251 241 252 242 // Feeds
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)