Changeset 56657 for trunk/tests/phpunit/tests/canonical.php
- Timestamp:
- 09/22/2023 12:02:28 AM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/canonical.php
r56559 r56657 14 14 parent::set_up(); 15 15 wp_set_current_user( self::$author_id ); 16 17 add_filter( 'pre_option_wp_attachment_pages_enabled', '__return_true' ); 16 18 } 17 19 … … 403 405 $this->assertNull( $url ); 404 406 } 407 408 /** 409 * @ticket 57913 410 */ 411 public function test_canonical_attachment_page_redirect_with_option_disabled() { 412 add_filter( 'pre_option_wp_attachment_pages_enabled', '__return_false' ); 413 414 $filename = DIR_TESTDATA . '/images/test-image.jpg'; 415 $contents = file_get_contents( $filename ); 416 $upload = wp_upload_bits( wp_basename( $filename ), null, $contents ); 417 418 $attachment_id = $this->_make_attachment( $upload ); 419 $attachment_page = get_permalink( $attachment_id ); 420 421 $this->go_to( $attachment_page ); 422 423 $url = redirect_canonical( $attachment_page, false ); 424 $expected = wp_get_attachment_url( $attachment_id ); 425 426 $this->assertSame( $expected, $url ); 427 } 405 428 }
Note: See TracChangeset
for help on using the changeset viewer.