Changeset 43571 for trunk/tests/phpunit/tests/rewrite/oldDateRedirect.php
- Timestamp:
- 08/17/2018 01:50:26 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rewrite/oldDateRedirect.php
r42587 r43571 12 12 13 13 public static function wpSetUpBeforeClass() { 14 self::$post_id = self::factory()->post->create( array( 15 'post_title' => 'Foo Bar', 16 'post_name' => 'foo-bar', 17 ) ); 14 self::$post_id = self::factory()->post->create( 15 array( 16 'post_title' => 'Foo Bar', 17 'post_name' => 'foo-bar', 18 ) 19 ); 18 20 19 21 self::$attachment_id = self::factory()->attachment->create_object( … … 50 52 51 53 $time = '2004-01-03 00:00:00'; 52 wp_update_post( array( 53 'ID' => self::$post_id, 54 'post_date' => $time, 55 'post_date_gmt' => get_gmt_from_date( $time ), 56 ) ); 54 wp_update_post( 55 array( 56 'ID' => self::$post_id, 57 'post_date' => $time, 58 'post_date_gmt' => get_gmt_from_date( $time ), 59 ) 60 ); 57 61 58 62 $permalink = user_trailingslashit( get_permalink( self::$post_id ) ); … … 67 71 68 72 $time = '2004-01-03 00:00:00'; 69 wp_update_post( array( 70 'ID' => self::$post_id, 71 'post_date' => $time, 72 'post_date_gmt' => get_gmt_from_date( $time ), 73 'post_name' => 'bar-baz', 74 ) ); 73 wp_update_post( 74 array( 75 'ID' => self::$post_id, 76 'post_date' => $time, 77 'post_date_gmt' => get_gmt_from_date( $time ), 78 'post_name' => 'bar-baz', 79 ) 80 ); 75 81 76 82 $permalink = user_trailingslashit( get_permalink( self::$post_id ) ); … … 85 91 86 92 $time = '2004-01-03 00:00:00'; 87 wp_update_post( array( 88 'ID' => self::$post_id, 89 'post_date' => $time, 90 'post_date_gmt' => get_gmt_from_date( $time ), 91 ) ); 93 wp_update_post( 94 array( 95 'ID' => self::$post_id, 96 'post_date' => $time, 97 'post_date_gmt' => get_gmt_from_date( $time ), 98 ) 99 ); 92 100 93 101 $this->go_to( $old_permalink ); … … 98 106 $old_permalink = get_attachment_link( self::$attachment_id ); 99 107 100 wp_update_post( array( 101 'ID' => self::$attachment_id, 102 'post_name' => 'the-attachment', 103 ) ); 108 wp_update_post( 109 array( 110 'ID' => self::$attachment_id, 111 'post_name' => 'the-attachment', 112 ) 113 ); 104 114 105 115 $permalink = user_trailingslashit( trailingslashit( get_permalink( self::$post_id ) ) . 'the-attachment' ); … … 114 124 115 125 $time = '2004-01-03 00:00:00'; 116 wp_update_post( array( 117 'ID' => self::$post_id, 118 'post_date' => $time, 119 'post_date_gmt' => get_gmt_from_date( $time ), 120 'post_name' => 'bar-baz', 121 ) ); 126 wp_update_post( 127 array( 128 'ID' => self::$post_id, 129 'post_date' => $time, 130 'post_date_gmt' => get_gmt_from_date( $time ), 131 'post_name' => 'bar-baz', 132 ) 133 ); 122 134 123 135 $this->go_to( $old_permalink ); … … 128 140 $old_permalink = get_attachment_link( self::$attachment_id ); 129 141 130 wp_update_post( array( 131 'ID' => self::$attachment_id, 132 'post_name' => 'the-attachment', 133 ) ); 142 wp_update_post( 143 array( 144 'ID' => self::$attachment_id, 145 'post_name' => 'the-attachment', 146 ) 147 ); 134 148 135 149 $permalink = user_trailingslashit( trailingslashit( get_permalink( self::$post_id ) ) . 'the-attachment' ); … … 141 155 142 156 public function test_old_date_redirect_paged() { 143 wp_update_post( array( 144 'ID' => self::$post_id, 145 'post_content' => 'Test<!--nextpage-->Test', 146 ) ); 157 wp_update_post( 158 array( 159 'ID' => self::$post_id, 160 'post_content' => 'Test<!--nextpage-->Test', 161 ) 162 ); 147 163 148 164 $old_permalink = user_trailingslashit( trailingslashit( get_permalink( self::$post_id ) ) . 'page/2' ); 149 165 150 166 $time = '2004-01-03 00:00:00'; 151 wp_update_post( array( 152 'ID' => self::$post_id, 153 'post_date' => $time, 154 'post_date_gmt' => get_gmt_from_date( $time ), 155 ) ); 167 wp_update_post( 168 array( 169 'ID' => self::$post_id, 170 'post_date' => $time, 171 'post_date_gmt' => get_gmt_from_date( $time ), 172 ) 173 ); 156 174 157 175 $permalink = user_trailingslashit( trailingslashit( get_permalink( self::$post_id ) ) . 'page/2' ); … … 163 181 164 182 public function test_old_date_slug_redirect_paged() { 165 wp_update_post( array( 166 'ID' => self::$post_id, 167 'post_content' => 'Test<!--nextpage-->Test', 168 ) ); 183 wp_update_post( 184 array( 185 'ID' => self::$post_id, 186 'post_content' => 'Test<!--nextpage-->Test', 187 ) 188 ); 169 189 170 190 $old_permalink = user_trailingslashit( trailingslashit( get_permalink( self::$post_id ) ) . 'page/2' ); 171 191 172 192 $time = '2004-01-04 12:00:00'; 173 wp_update_post( array( 174 'ID' => self::$post_id, 175 'post_date' => $time, 176 'post_date_gmt' => get_gmt_from_date( $time ), 177 'post_name' => 'bar-baz', 178 ) ); 193 wp_update_post( 194 array( 195 'ID' => self::$post_id, 196 'post_date' => $time, 197 'post_date_gmt' => get_gmt_from_date( $time ), 198 'post_name' => 'bar-baz', 199 ) 200 ); 179 201 180 202 $permalink = user_trailingslashit( trailingslashit( get_permalink( self::$post_id ) ) . 'page/2' ); … … 189 211 190 212 $time = '2004-01-04 12:00:00'; 191 wp_update_post( array( 192 'ID' => self::$post_id, 193 'post_date' => $time, 194 'post_date_gmt' => get_gmt_from_date( $time ), 195 'post_name' => 'bar-baz', 196 ) ); 197 198 $new_post_id = self::factory()->post->create( array( 199 'post_title' => 'Foo Bar', 200 'post_name' => 'foo-bar', 201 ) ); 213 wp_update_post( 214 array( 215 'ID' => self::$post_id, 216 'post_date' => $time, 217 'post_date_gmt' => get_gmt_from_date( $time ), 218 'post_name' => 'bar-baz', 219 ) 220 ); 221 222 $new_post_id = self::factory()->post->create( 223 array( 224 'post_title' => 'Foo Bar', 225 'post_name' => 'foo-bar', 226 ) 227 ); 202 228 203 229 $permalink = user_trailingslashit( get_permalink( $new_post_id ) );
Note: See TracChangeset
for help on using the changeset viewer.