Changeset 52010 for trunk/tests/phpunit/tests/rewrite.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rewrite.php
r51568 r52010 9 9 private $home_url; 10 10 11 function set_up() {11 public function set_up() { 12 12 parent::set_up(); 13 13 … … 18 18 } 19 19 20 function tear_down() {20 public function tear_down() { 21 21 global $wp_rewrite; 22 22 $wp_rewrite->init(); … … 86 86 } 87 87 88 function test_url_to_postid() {88 public function test_url_to_postid() { 89 89 90 90 $id = self::factory()->post->create(); … … 95 95 } 96 96 97 function test_url_to_postid_set_url_scheme_https_to_http() {97 public function test_url_to_postid_set_url_scheme_https_to_http() { 98 98 $post_id = self::factory()->post->create(); 99 99 $permalink = get_permalink( $post_id ); … … 105 105 } 106 106 107 function test_url_to_postid_set_url_scheme_http_to_https() {107 public function test_url_to_postid_set_url_scheme_http_to_https() { 108 108 $_SERVER['HTTPS'] = 'on'; 109 109 … … 125 125 * @group ms-required 126 126 */ 127 function test_url_to_postid_of_http_site_when_current_site_uses_https() {127 public function test_url_to_postid_of_http_site_when_current_site_uses_https() { 128 128 $_SERVER['HTTPS'] = 'on'; 129 129 … … 131 131 $this->blog_id_35531 = self::factory()->blog->create(); 132 132 133 add_filter( 'home_url', array( $this, ' _filter_http_home_url' ), 10, 4 );133 add_filter( 'home_url', array( $this, 'filter_http_home_url' ), 10, 4 ); 134 134 135 135 switch_to_blog( $this->blog_id_35531 ); … … 142 142 143 143 // Cleanup. 144 remove_filter( 'home_url', array( $this, ' _filter_http_home_url' ), 10 );144 remove_filter( 'home_url', array( $this, 'filter_http_home_url' ), 10 ); 145 145 146 146 // Test the tests. … … 161 161 * @return string The complete home URL including scheme and path. 162 162 */ 163 function _filter_http_home_url( $url, $path, $orig_scheme, $_blog_id ) {163 public function filter_http_home_url( $url, $path, $orig_scheme, $_blog_id ) { 164 164 global $blog_id; 165 165 … … 171 171 } 172 172 173 function test_url_to_postid_custom_post_type() {173 public function test_url_to_postid_custom_post_type() { 174 174 delete_option( 'rewrite_rules' ); 175 175 … … 183 183 } 184 184 185 function test_url_to_postid_hierarchical() {185 public function test_url_to_postid_hierarchical() { 186 186 187 187 $parent_id = self::factory()->post->create( … … 203 203 } 204 204 205 function test_url_to_postid_hierarchical_with_matching_leaves() {205 public function test_url_to_postid_hierarchical_with_matching_leaves() { 206 206 207 207 $parent_id = self::factory()->post->create( … … 246 246 } 247 247 248 function test_url_to_postid_home_has_path() {248 public function test_url_to_postid_home_has_path() { 249 249 250 250 update_option( 'home', home_url( '/example/' ) ); … … 272 272 * @ticket 30438 273 273 */ 274 function test_parse_request_home_path() {274 public function test_parse_request_home_path() { 275 275 $home_url = home_url( '/path/' ); 276 276 update_option( 'home', $home_url ); … … 292 292 * @ticket 30438 293 293 */ 294 function test_parse_request_home_path_with_regex_character() {294 public function test_parse_request_home_path_with_regex_character() { 295 295 $home_url = home_url( '/ma.ch/' ); 296 296 $not_a_home_url = home_url( '/match/' ); … … 329 329 * @ticket 30018 330 330 */ 331 function test_parse_request_home_path_non_public_type() {331 public function test_parse_request_home_path_non_public_type() { 332 332 register_post_type( 'foo', array( 'public' => false ) ); 333 333 … … 341 341 } 342 342 343 function test_url_to_postid_dupe_path() {343 public function test_url_to_postid_dupe_path() { 344 344 update_option( 'home', home_url( '/example/' ) ); 345 345 … … 361 361 * Reveals bug introduced in WP 3.0 362 362 */ 363 function test_url_to_postid_home_url_collision() {363 public function test_url_to_postid_home_url_collision() { 364 364 update_option( 'home', home_url( '/example' ) ); 365 365 … … 382 382 * @group ms-required 383 383 */ 384 function test_url_to_postid_ms_home_url_collision() {384 public function test_url_to_postid_ms_home_url_collision() { 385 385 $blog_id = self::factory()->blog->create( array( 'path' => '/example' ) ); 386 386 switch_to_blog( $blog_id ); … … 403 403 * @ticket 21970 404 404 */ 405 function test_url_to_postid_with_post_slug_that_clashes_with_a_trashed_page() {405 public function test_url_to_postid_with_post_slug_that_clashes_with_a_trashed_page() { 406 406 $this->set_permalink_structure( '/%postname%/' ); 407 407 … … 420 420 * @ticket 34971 421 421 */ 422 function test_url_to_postid_static_front_page() {422 public function test_url_to_postid_static_front_page() { 423 423 $post_id = self::factory()->post->create( array( 'post_type' => 'page' ) ); 424 424 … … 454 454 * @ticket 21970 455 455 */ 456 function test_parse_request_with_post_slug_that_clashes_with_a_trashed_page() {456 public function test_parse_request_with_post_slug_that_clashes_with_a_trashed_page() { 457 457 $this->set_permalink_structure( '/%postname%/' ); 458 458
Note: See TracChangeset
for help on using the changeset viewer.