Changeset 42343 for trunk/tests/phpunit/tests/canonical.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/canonical.php
r38398 r42343 22 22 23 23 if ( false !== strpos( $test_url, '%d' ) ) { 24 if ( false !== strpos( $test_url, '/?author=%d' ) ) 24 if ( false !== strpos( $test_url, '/?author=%d' ) ) { 25 25 $test_url = sprintf( $test_url, self::$author_id ); 26 if ( false !== strpos( $test_url, '?cat=%d' ) ) 26 } 27 if ( false !== strpos( $test_url, '?cat=%d' ) ) { 27 28 $test_url = sprintf( $test_url, self::$terms[ $expected['url'] ] ); 29 } 28 30 } 29 31 … … 49 51 array( '?cat=%d', array( 'url' => '/category/parent/child-1/' ), 15256 ), 50 52 array( '?cat=%d', array( 'url' => '/category/parent/child-1/child-2/' ) ), // no children 51 array( '/category/uncategorized/', array( 'url' => '/category/uncategorized/', 'qv' => array( 'category_name' => 'uncategorized' ) ) ), 52 array( '/category/uncategorized/page/2/', array( 'url' => '/category/uncategorized/page/2/', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2) ) ), 53 array( '/category/uncategorized/?paged=2', array( 'url' => '/category/uncategorized/page/2/', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2) ) ), 54 array( '/category/uncategorized/?paged=2&category_name=uncategorized', array( 'url' => '/category/uncategorized/page/2/', 'qv' => array( 'category_name' => 'uncategorized', 'paged' => 2) ), 17174 ), 53 array( 54 '/category/uncategorized/', 55 array( 56 'url' => '/category/uncategorized/', 57 'qv' => array( 'category_name' => 'uncategorized' ), 58 ), 59 ), 60 array( 61 '/category/uncategorized/page/2/', 62 array( 63 'url' => '/category/uncategorized/page/2/', 64 'qv' => array( 65 'category_name' => 'uncategorized', 66 'paged' => 2, 67 ), 68 ), 69 ), 70 array( 71 '/category/uncategorized/?paged=2', 72 array( 73 'url' => '/category/uncategorized/page/2/', 74 'qv' => array( 75 'category_name' => 'uncategorized', 76 'paged' => 2, 77 ), 78 ), 79 ), 80 array( 81 '/category/uncategorized/?paged=2&category_name=uncategorized', 82 array( 83 'url' => '/category/uncategorized/page/2/', 84 'qv' => array( 85 'category_name' => 'uncategorized', 86 'paged' => 2, 87 ), 88 ), 89 17174, 90 ), 55 91 56 92 // Categories & Intersections with other vars 57 array( '/category/uncategorized/?tag=post-formats', array( 'url' => '/category/uncategorized/?tag=post-formats', 'qv' => array('category_name' => 'uncategorized', 'tag' => 'post-formats') ) ), 58 array( '/?category_name=cat-a,cat-b', array( 'url' => '/?category_name=cat-a,cat-b', 'qv' => array( 'category_name' => 'cat-a,cat-b' ) ) ), 93 array( 94 '/category/uncategorized/?tag=post-formats', 95 array( 96 'url' => '/category/uncategorized/?tag=post-formats', 97 'qv' => array( 98 'category_name' => 'uncategorized', 99 'tag' => 'post-formats', 100 ), 101 ), 102 ), 103 array( 104 '/?category_name=cat-a,cat-b', 105 array( 106 'url' => '/?category_name=cat-a,cat-b', 107 'qv' => array( 'category_name' => 'cat-a,cat-b' ), 108 ), 109 ), 59 110 60 111 // Taxonomies with extra Query Vars 61 array( '/category/cat-a/page/1/?test=one%20two', '/category/cat-a/?test=one%20two', 18086 ), // Extra query vars should stay encoded112 array( '/category/cat-a/page/1/?test=one%20two', '/category/cat-a/?test=one%20two', 18086 ), // Extra query vars should stay encoded 62 113 63 114 // Categories with Dates 64 array( '/2008/04/?cat=1', array( 'url' => '/2008/04/?cat=1', 'qv' => array('cat' => '1', 'year' => '2008', 'monthnum' => '04' ) ), 17661 ), 65 // array( '/2008/?category_name=cat-a', array( 'url' => '/2008/?category_name=cat-a', 'qv' => array('category_name' => 'cat-a', 'year' => '2008' ) ) ), 66 67 // Pages 68 array( '/child-page-1/', '/parent-page/child-page-1/'), 69 array( '/?page_id=144', '/parent-page/child-page-1/'), 115 array( 116 '/2008/04/?cat=1', 117 array( 118 'url' => '/2008/04/?cat=1', 119 'qv' => array( 120 'cat' => '1', 121 'year' => '2008', 122 'monthnum' => '04', 123 ), 124 ), 125 17661, 126 ), 127 // array( '/2008/?category_name=cat-a', array( 'url' => '/2008/?category_name=cat-a', 'qv' => array('category_name' => 'cat-a', 'year' => '2008' ) ) ), 128 129 // Pages 130 array( '/child-page-1/', '/parent-page/child-page-1/' ), 131 array( '/?page_id=144', '/parent-page/child-page-1/' ), 70 132 array( '/abo', '/about/' ), 71 133 array( '/parent/child1/grandchild/', '/parent/child1/grandchild/' ), … … 73 135 74 136 // Posts 75 array( '?p=587', '/2008/06/02/post-format-test-audio/' ),76 array( '/?name=images-test', '/2008/09/03/images-test/' ),137 array( '?p=587', '/2008/06/02/post-format-test-audio/' ), 138 array( '/?name=images-test', '/2008/09/03/images-test/' ), 77 139 // Incomplete slug should resolve and remove the ?name= parameter 78 array( '/?name=images-te', '/2008/09/03/images-test/', 20374 ),140 array( '/?name=images-te', '/2008/09/03/images-test/', 20374 ), 79 141 // Page slug should resolve to post slug and remove the ?pagename= parameter 80 array( '/?pagename=images-test', '/2008/09/03/images-test/', 20374), 81 82 array( '/2008/06/02/post-format-test-au/', '/2008/06/02/post-format-test-audio/'), 83 array( '/2008/06/post-format-test-au/', '/2008/06/02/post-format-test-audio/'), 84 array( '/2008/post-format-test-au/', '/2008/06/02/post-format-test-audio/'), 85 array( '/2010/post-format-test-au/', '/2008/06/02/post-format-test-audio/'), // A Year the post is not in 86 array( '/post-format-test-au/', '/2008/06/02/post-format-test-audio/'), 87 88 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' ) ) ), 142 array( '/?pagename=images-test', '/2008/09/03/images-test/', 20374 ), 143 144 array( '/2008/06/02/post-format-test-au/', '/2008/06/02/post-format-test-audio/' ), 145 array( '/2008/06/post-format-test-au/', '/2008/06/02/post-format-test-audio/' ), 146 array( '/2008/post-format-test-au/', '/2008/06/02/post-format-test-audio/' ), 147 array( '/2010/post-format-test-au/', '/2008/06/02/post-format-test-audio/' ), // A Year the post is not in 148 array( '/post-format-test-au/', '/2008/06/02/post-format-test-audio/' ), 149 150 array( 151 '/2008/09/03/images-test/3/', 152 array( 153 'url' => '/2008/09/03/images-test/3/', 154 'qv' => array( 155 'name' => 'images-test', 156 'year' => '2008', 157 'monthnum' => '09', 158 'day' => '03', 159 'page' => '3', 160 ), 161 ), 162 ), 89 163 array( '/2008/09/03/images-test/?page=3', '/2008/09/03/images-test/3/' ), 90 164 array( '/2008/09/03/images-te?page=3', '/2008/09/03/images-test/3/' ), … … 99 173 // Dates 100 174 array( '/?m=2008', '/2008/' ), 101 array( '/?m=200809', '/2008/09/' ),102 array( '/?m=20080905', '/2008/09/05/' ),103 104 array( '/2008/?day=05', '/2008/?day=05' ), // no redirect105 array( '/2008/09/?day=05', '/2008/09/05/' ),106 array( '/2008/?monthnum=9', '/2008/09/' ),107 108 array( '/?year=2008', '/2008/' ),109 110 array( '/2012/13/', '/2012/' ),175 array( '/?m=200809', '/2008/09/' ), 176 array( '/?m=20080905', '/2008/09/05/' ), 177 178 array( '/2008/?day=05', '/2008/?day=05' ), // no redirect 179 array( '/2008/09/?day=05', '/2008/09/05/' ), 180 array( '/2008/?monthnum=9', '/2008/09/' ), 181 182 array( '/?year=2008', '/2008/' ), 183 184 array( '/2012/13/', '/2012/' ), 111 185 array( '/2012/11/51/', '/2012/11/', 0, array( 'WP_Date_Query' ) ), 112 186 113 187 // Authors 114 188 array( '/?author=%d', '/author/canonical-author/' ), 115 //array( '/?author=%d&year=2008', '/2008/?author=3'),116 //array( '/author/canonical-author/?year=2008', '/2008/?author=3'), //Either or, see previous testcase.117 118 // Feeds119 array( '/?feed=atom', '/feed/atom/' ),189 // array( '/?author=%d&year=2008', '/2008/?author=3'), 190 // array( '/author/canonical-author/?year=2008', '/2008/?author=3'), //Either or, see previous testcase. 191 192 // Feeds 193 array( '/?feed=atom', '/feed/atom/' ), 120 194 array( '/?feed=rss2', '/feed/' ), 121 array( '/?feed=comments-rss2', '/comments/feed/' ),122 array( '/?feed=comments-atom', '/comments/feed/atom/' ),195 array( '/?feed=comments-rss2', '/comments/feed/' ), 196 array( '/?feed=comments-atom', '/comments/feed/atom/' ), 123 197 124 198 // Feeds (per-post) 125 array( '/2008/03/03/comment-test/?feed=comments-atom', '/2008/03/03/comment-test/feed/atom/' ),126 array( '/?p=149&feed=comments-atom', '/2008/03/03/comment-test/feed/atom/' ),199 array( '/2008/03/03/comment-test/?feed=comments-atom', '/2008/03/03/comment-test/feed/atom/' ), 200 array( '/?p=149&feed=comments-atom', '/2008/03/03/comment-test/feed/atom/' ), 127 201 128 202 // Index
Note: See TracChangeset
for help on using the changeset viewer.