Changeset 47122 for trunk/tests/phpunit/tests/canonical/noRewrite.php
- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/canonical/noRewrite.php
r46586 r47122 10 10 class Tests_Canonical_NoRewrite extends WP_Canonical_UnitTestCase { 11 11 12 // These test cases are run against the test handler in WP_Canonical 12 // These test cases are run against the test handler in WP_Canonical. 13 13 14 14 public function setUp() { … … 30 30 31 31 function data() { 32 /* Format: 33 * [0]: $test_url, 34 * [1]: expected results: Any of the following can be used 32 /* 33 * Test URL. 34 * [0]: Test URL. 35 * [1]: Expected results: Any of the following can be used. 35 36 * array( 'url': expected redirection location, 'qv': expected query vars to be set via the rewrite AND $_GET ); 36 37 * array( expected query vars to be set, same as 'qv' above ) … … 41 42 array( '/?p=123', '/?p=123' ), 42 43 43 // This post_type arg should be stripped, because p=1 exists, and does not have post_type= in its query string 44 // This post_type arg should be stripped, because p=1 exists, and does not have post_type= in its query string. 44 45 array( '/?post_type=fake-cpt&p=1', '/?p=1' ), 45 46 46 // Strip an existing but incorrect post_type arg 47 // Strip an existing but incorrect post_type arg. 47 48 array( '/?post_type=page&page_id=1', '/?p=1' ), 48 49 49 50 // Trailing spaces and punctuation in query string args. 50 array( 51 array( // Space. 51 52 '/?p=358 ', 52 53 array( … … 55 56 ), 56 57 20383, 57 ), // space58 array( 58 ), 59 array( // Encoded space. 59 60 '/?p=358%20', 60 61 array( … … 63 64 ), 64 65 20383, 65 ), // encoded space66 array( 66 ), 67 array( // Exclamation mark. 67 68 '/?p=358!', 68 69 array( … … 71 72 ), 72 73 20383, 73 ), // exclamation mark74 array( 74 ), 75 array( // Encoded exclamation mark. 75 76 '/?p=358%21', 76 77 array( … … 79 80 ), 80 81 20383, 81 ), // encoded exclamation mark82 array( 82 ), 83 array( // Double quote. 83 84 '/?p=358"', 84 85 array( … … 87 88 ), 88 89 20383, 89 ), // double quote90 array( 90 ), 91 array( // Encoded double quote. 91 92 '/?p=358%22', 92 93 array( … … 95 96 ), 96 97 20383, 97 ), // encoded double quote98 array( 98 ), 99 array( // Single quote. 99 100 '/?p=358\'', 100 101 array( … … 103 104 ), 104 105 20383, 105 ), // single quote106 array( 106 ), 107 array( // Encoded single quote. 107 108 '/?p=358%27', 108 109 array( … … 111 112 ), 112 113 20383, 113 ), // encoded single quote114 array( 114 ), 115 array( // Opening bracket. 115 116 '/?p=358(', 116 117 array( … … 119 120 ), 120 121 20383, 121 ), // opening bracket122 array( 122 ), 123 array( // Encoded opening bracket. 123 124 '/?p=358%28', 124 125 array( … … 127 128 ), 128 129 20383, 129 ), // encoded opening bracket130 array( 130 ), 131 array( // Closing bracket. 131 132 '/?p=358)', 132 133 array( … … 135 136 ), 136 137 20383, 137 ), // closing bracket138 array( 138 ), 139 array( // Encoded closing bracket. 139 140 '/?p=358%29', 140 141 array( … … 143 144 ), 144 145 20383, 145 ), // encoded closing bracket146 array( 146 ), 147 array( // Comma. 147 148 '/?p=358,', 148 149 array( … … 151 152 ), 152 153 20383, 153 ), // comma154 array( 154 ), 155 array( // Encoded comma. 155 156 '/?p=358%2C', 156 157 array( … … 159 160 ), 160 161 20383, 161 ), // encoded comma162 array( 162 ), 163 array( // Period. 163 164 '/?p=358.', 164 165 array( … … 167 168 ), 168 169 20383, 169 ), // period170 array( 170 ), 171 array( // Encoded period. 171 172 '/?p=358%2E', 172 173 array( … … 175 176 ), 176 177 20383, 177 ), // encoded period178 array( 178 ), 179 array( // Semicolon. 179 180 '/?p=358;', 180 181 array( … … 183 184 ), 184 185 20383, 185 ), // semicolon186 array( 186 ), 187 array( // Encoded semicolon. 187 188 '/?p=358%3B', 188 189 array( … … 191 192 ), 192 193 20383, 193 ), // encoded semicolon194 array( 194 ), 195 array( // Opening curly bracket. 195 196 '/?p=358{', 196 197 array( … … 199 200 ), 200 201 20383, 201 ), // opening curly bracket202 array( 202 ), 203 array( // Encoded opening curly bracket. 203 204 '/?p=358%7B', 204 205 array( … … 207 208 ), 208 209 20383, 209 ), // encoded opening curly bracket210 array( 210 ), 211 array( // Closing curly bracket. 211 212 '/?p=358}', 212 213 array( … … 215 216 ), 216 217 20383, 217 ), // closing curly bracket218 array( 218 ), 219 array( // Encoded closing curly bracket. 219 220 '/?p=358%7D', 220 221 array( … … 223 224 ), 224 225 20383, 225 ), // encoded closing curly bracket226 array( 226 ), 227 array( // Encoded opening curly quote. 227 228 '/?p=358%E2%80%9C', 228 229 array( … … 231 232 ), 232 233 20383, 233 ), // encoded opening curly quote234 array( 234 ), 235 array( // Encoded closing curly quote. 235 236 '/?p=358%E2%80%9D', 236 237 array( … … 239 240 ), 240 241 20383, 241 ), // encoded closing curly quote242 ), 242 243 243 244 // Trailing spaces and punctuation in permalinks. 244 array( '/page/2/ ', '/page/2/', 20383 ), // space245 array( '/page/2/%20', '/page/2/', 20383 ), // encoded space246 array( '/page/2/!', '/page/2/', 20383 ), // exclamation mark247 array( '/page/2/%21', '/page/2/', 20383 ), // encoded exclamation mark248 array( '/page/2/"', '/page/2/', 20383 ), // double quote249 array( '/page/2/%22', '/page/2/', 20383 ), // encoded double quote250 array( '/page/2/\'', '/page/2/', 20383 ), // single quote251 array( '/page/2/%27', '/page/2/', 20383 ), // encoded single quote252 array( '/page/2/(', '/page/2/', 20383 ), // opening bracket253 array( '/page/2/%28', '/page/2/', 20383 ), // encoded opening bracket254 array( '/page/2/)', '/page/2/', 20383 ), // closing bracket255 array( '/page/2/%29', '/page/2/', 20383 ), // encoded closing bracket256 array( '/page/2/,', '/page/2/', 20383 ), // comma257 array( '/page/2/%2C', '/page/2/', 20383 ), // encoded comma258 array( '/page/2/.', '/page/2/', 20383 ), // period259 array( '/page/2/%2E', '/page/2/', 20383 ), // encoded period260 array( '/page/2/;', '/page/2/', 20383 ), // semicolon261 array( '/page/2/%3B', '/page/2/', 20383 ), // encoded semicolon262 array( '/page/2/{', '/page/2/', 20383 ), // opening curly bracket263 array( '/page/2/%7B', '/page/2/', 20383 ), // encoded opening curly bracket264 array( '/page/2/}', '/page/2/', 20383 ), // closing curly bracket265 array( '/page/2/%7D', '/page/2/', 20383 ), // encoded closing curly bracket266 array( '/page/2/%E2%80%9C', '/page/2/', 20383 ), // encoded opening curly quote267 array( '/page/2/%E2%80%9D', '/page/2/', 20383 ), // encoded closing curly quote268 269 array( '/?page_id=1', '/?p=1' ), // redirect page_id to p (should cover page_id|p|attachment_id to one another245 array( '/page/2/ ', '/page/2/', 20383 ), // Space. 246 array( '/page/2/%20', '/page/2/', 20383 ), // Encoded space. 247 array( '/page/2/!', '/page/2/', 20383 ), // Exclamation mark. 248 array( '/page/2/%21', '/page/2/', 20383 ), // Encoded exclamation mark. 249 array( '/page/2/"', '/page/2/', 20383 ), // Double quote. 250 array( '/page/2/%22', '/page/2/', 20383 ), // Encoded double quote. 251 array( '/page/2/\'', '/page/2/', 20383 ), // Single quote. 252 array( '/page/2/%27', '/page/2/', 20383 ), // Encoded single quote. 253 array( '/page/2/(', '/page/2/', 20383 ), // Opening bracket. 254 array( '/page/2/%28', '/page/2/', 20383 ), // Encoded opening bracket. 255 array( '/page/2/)', '/page/2/', 20383 ), // Closing bracket. 256 array( '/page/2/%29', '/page/2/', 20383 ), // Encoded closing bracket. 257 array( '/page/2/,', '/page/2/', 20383 ), // Comma. 258 array( '/page/2/%2C', '/page/2/', 20383 ), // Encoded comma. 259 array( '/page/2/.', '/page/2/', 20383 ), // Period. 260 array( '/page/2/%2E', '/page/2/', 20383 ), // Encoded period. 261 array( '/page/2/;', '/page/2/', 20383 ), // Semicolon. 262 array( '/page/2/%3B', '/page/2/', 20383 ), // Encoded semicolon. 263 array( '/page/2/{', '/page/2/', 20383 ), // Opening curly bracket. 264 array( '/page/2/%7B', '/page/2/', 20383 ), // Encoded opening curly bracket. 265 array( '/page/2/}', '/page/2/', 20383 ), // Closing curly bracket. 266 array( '/page/2/%7D', '/page/2/', 20383 ), // Encoded closing curly bracket. 267 array( '/page/2/%E2%80%9C', '/page/2/', 20383 ), // Encoded opening curly quote. 268 array( '/page/2/%E2%80%9D', '/page/2/', 20383 ), // Encoded closing curly quote. 269 270 array( '/?page_id=1', '/?p=1' ), // Redirect page_id to p (should cover page_id|p|attachment_id to one another. 270 271 array( '/?page_id=1&post_type=revision', '/?p=1' ), 271 272
Note: See TracChangeset
for help on using the changeset viewer.