You appear to be a bot. Output may be restricted
Description
Usage
Tests_Rewrite_OldDateRedirect::test_old_date_slug_redirect_attachment();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/rewrite/oldDateRedirect.php
Lines:
1 to 33 of 33
public function test_old_date_slug_redirect_attachment() { $old_permalink = get_attachment_link( self::$attachment_id ); $time = '2004-01-03 00:00:00'; wp_update_post( array( 'ID' => self::$post_id, 'post_date' => $time, 'post_date_gmt' => get_gmt_from_date( $time ), 'post_name' => 'bar-baz', ) ); $this->go_to( $old_permalink ); wp_old_slug_redirect(); $this->assertNull( $this->old_date_redirect_url ); $this->assertQueryTrue( 'is_attachment', 'is_singular', 'is_single' ); $old_permalink = get_attachment_link( self::$attachment_id ); wp_update_post( array( 'ID' => self::$attachment_id, 'post_name' => 'the-attachment', ) ); $permalink = user_trailingslashit( trailingslashit( get_permalink( self::$post_id ) ) . 'the-attachment' ); $this->go_to( $old_permalink ); wp_old_slug_redirect(); $this->assertSame( $permalink, $this->old_date_redirect_url ); }