Changeset 47122 for trunk/tests/phpunit/includes/testcase-canonical.php
- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/testcase-canonical.php
r46586 r47122 264 264 $parsed_can_url = parse_url( $can_url ); 265 265 266 // Just test the Path and Query if present266 // Just test the path and query if present. 267 267 if ( isset( $expected['url'] ) ) { 268 268 $this->assertEquals( $expected['url'], $parsed_can_url['path'] . ( ! empty( $parsed_can_url['query'] ) ? '?' . $parsed_can_url['query'] : '' ), $ticket_ref ); 269 269 } 270 270 271 // If the test data doesn't include expected query vars, then we're done here 271 // If the test data doesn't include expected query vars, then we're done here. 272 272 if ( ! isset( $expected['qv'] ) ) { 273 273 return; 274 274 } 275 275 276 // "make" that the request and check the query is correct 276 // "make" that the request and check the query is correct. 277 277 $this->go_to( $can_url ); 278 278 279 // Are all query vars accounted for, And correct?279 // Are all query vars accounted for, and correct? 280 280 global $wp; 281 281 … … 284 284 parse_str( $parsed_can_url['query'], $_qv ); 285 285 286 // $_qv should not contain any elements which are set in $query_vars already (ie. $_GET vars should not be present in the Rewrite) 286 // $_qv should not contain any elements which are set in $query_vars already 287 // (i.e. $_GET vars should not be present in the Rewrite). 287 288 $this->assertEquals( array(), array_intersect( $query_vars, $_qv ), 'Query vars are duplicated from the Rewrite into $_GET; ' . $ticket_ref ); 288 289 … … 306 307 $can_url = redirect_canonical( $test_url, false ); 307 308 if ( ! $can_url ) { 308 return $test_url; // No redirect will take place for this request 309 return $test_url; // No redirect will take place for this request. 309 310 } 310 311
Note: See TracChangeset
for help on using the changeset viewer.