Changeset 34810 for trunk/tests/phpunit/tests/post/wpUniquePostSlug.php
- Timestamp:
- 10/03/2015 08:54:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/wpUniquePostSlug.php
r34802 r34810 170 170 */ 171 171 public function test_slugs_resulting_in_permalinks_that_resemble_year_archives_should_be_suffixed() { 172 global $wp_rewrite; 173 $wp_rewrite->init(); 174 $wp_rewrite->set_permalink_structure( '/%postname%/' ); 175 $wp_rewrite->flush_rules(); 172 $this->set_permalink_structure( '/%postname%/' ); 176 173 177 174 $p = $this->factory->post->create( array( … … 188 185 */ 189 186 public function test_slugs_resulting_in_permalinks_that_resemble_year_archives_should_not_be_suffixed_for_already_published_posts() { 190 global $wp_rewrite; 191 $wp_rewrite->init(); 192 $wp_rewrite->set_permalink_structure( '/%postname%/' ); 193 $wp_rewrite->flush_rules(); 187 $this->set_permalink_structure( '/%postname%/' ); 194 188 195 189 $p = $this->factory->post->create( array( … … 207 201 */ 208 202 public function test_yearlike_slugs_should_not_be_suffixed_if_permalink_structure_does_not_result_in_a_clash_with_year_archives() { 209 global $wp_rewrite; 210 $wp_rewrite->init(); 211 $wp_rewrite->set_permalink_structure( '/%year%/%postname%/' ); 212 $wp_rewrite->flush_rules(); 203 $this->set_permalink_structure( '/%year%/%postname%/' ); 213 204 214 205 $p = $this->factory->post->create( array( … … 225 216 */ 226 217 public function test_slugs_resulting_in_permalinks_that_resemble_month_archives_should_be_suffixed() { 227 global $wp_rewrite; 228 $wp_rewrite->init(); 229 $wp_rewrite->set_permalink_structure( '/%year%/%postname%/' ); 230 $wp_rewrite->flush_rules(); 218 $this->set_permalink_structure( '/%year%/%postname%/' ); 231 219 232 220 $p = $this->factory->post->create( array( … … 243 231 */ 244 232 public function test_monthlike_slugs_should_not_be_suffixed_if_permalink_structure_does_not_result_in_a_clash_with_month_archives() { 245 global $wp_rewrite; 246 $wp_rewrite->init(); 247 $wp_rewrite->set_permalink_structure( '/%year%/foo/%postname%/' ); 248 $wp_rewrite->flush_rules(); 233 $this->set_permalink_structure( '/%year%/foo/%postname%/' ); 249 234 250 235 $p = $this->factory->post->create( array( … … 261 246 */ 262 247 public function test_monthlike_slugs_should_not_be_suffixed_for_invalid_month_numbers() { 263 global $wp_rewrite; 264 $wp_rewrite->init(); 265 $wp_rewrite->set_permalink_structure( '/%year%/%postname%/' ); 266 $wp_rewrite->flush_rules(); 248 $this->set_permalink_structure( '/%year%/%postname%/' ); 267 249 268 250 $p = $this->factory->post->create( array( … … 279 261 */ 280 262 public function test_slugs_resulting_in_permalinks_that_resemble_day_archives_should_be_suffixed() { 281 global $wp_rewrite; 282 $wp_rewrite->init(); 283 $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%postname%/' ); 284 $wp_rewrite->flush_rules(); 263 $this->set_permalink_structure( '/%year%/%monthnum%/%postname%/' ); 285 264 286 265 $p = $this->factory->post->create( array( … … 297 276 */ 298 277 public function test_daylike_slugs_should_not_be_suffixed_if_permalink_structure_does_not_result_in_a_clash_with_day_archives() { 299 global $wp_rewrite; 300 $wp_rewrite->init(); 301 $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); 302 $wp_rewrite->flush_rules(); 278 $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' ); 303 279 304 280 $p = $this->factory->post->create( array( … … 315 291 */ 316 292 public function test_daylike_slugs_should_not_be_suffixed_for_invalid_day_numbers() { 317 global $wp_rewrite; 318 $wp_rewrite->init(); 319 $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%postname%/' ); 320 $wp_rewrite->flush_rules(); 293 $this->set_permalink_structure( '/%year%/%monthnum%/%postname%/' ); 321 294 322 295 $p = $this->factory->post->create( array(
Note: See TracChangeset
for help on using the changeset viewer.