Changeset 34810 for trunk/tests/phpunit/tests/admin/includesPost.php
- Timestamp:
- 10/03/2015 08:54:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesPost.php
r34802 r34810 252 252 */ 253 253 public function test_get_sample_permalink_should_return_pretty_permalink_for_posts_with_post_status_future() { 254 global $wp_rewrite;255 256 254 $permalink_structure = '%postname%'; 257 $wp_rewrite->set_permalink_structure( "/$permalink_structure/" ); 258 flush_rewrite_rules(); 255 $this->set_permalink_structure( "/$permalink_structure/" ); 259 256 260 257 $future_date = date( 'Y-m-d H:i:s', time() + 100 ); … … 286 283 */ 287 284 public function test_get_sample_permalink_html_should_use_pretty_permalink_for_view_post_link_when_pretty_permalinks_are_enabled() { 288 global $wp_rewrite; 289 $permalink_structure = '%postname%'; 290 $wp_rewrite->set_permalink_structure( "/$permalink_structure/" ); 291 flush_rewrite_rules(); 285 $this->set_permalink_structure( '/%postname%/' ); 292 286 293 287 wp_set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) ); … … 306 300 */ 307 301 public function test_get_sample_permalink_html_should_use_correct_permalink_for_view_post_link_when_changing_slug() { 308 global $wp_rewrite; 309 $permalink_structure = '%postname%'; 310 $wp_rewrite->set_permalink_structure( "/$permalink_structure/" ); 311 flush_rewrite_rules(); 302 $this->set_permalink_structure( '/%postname%/' ); 312 303 313 304 wp_set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) ); … … 347 338 */ 348 339 public function test_get_sample_permalink_should_avoid_slugs_that_would_create_clashes_with_year_archives() { 349 global $wp_rewrite; 350 $wp_rewrite->init(); 351 $wp_rewrite->set_permalink_structure( '/%postname%/' ); 352 $wp_rewrite->flush_rules(); 340 $this->set_permalink_structure( '/%postname%/' ); 353 341 354 342 $p = $this->factory->post->create( array( … … 364 352 */ 365 353 public function test_get_sample_permalink_should_allow_yearlike_slugs_if_permastruct_does_not_cause_an_archive_conflict() { 366 global $wp_rewrite; 367 $wp_rewrite->init(); 368 $wp_rewrite->set_permalink_structure( '/%year%/%postname%/' ); 369 $wp_rewrite->flush_rules(); 354 $this->set_permalink_structure( '/%year%/%postname%/' ); 370 355 371 356 $p = $this->factory->post->create( array( … … 381 366 */ 382 367 public function test_get_sample_permalink_should_avoid_slugs_that_would_create_clashes_with_month_archives() { 383 global $wp_rewrite; 384 $wp_rewrite->init(); 385 $wp_rewrite->set_permalink_structure( '/%year%/%postname%/' ); 386 $wp_rewrite->flush_rules(); 368 $this->set_permalink_structure( '/%year%/%postname%/' ); 387 369 388 370 $p = $this->factory->post->create( array( … … 398 380 */ 399 381 public function test_get_sample_permalink_should_ignore_potential_month_conflicts_for_invalid_monthnum() { 400 global $wp_rewrite; 401 $wp_rewrite->init(); 402 $wp_rewrite->set_permalink_structure( '/%year%/%postname%/' ); 403 $wp_rewrite->flush_rules(); 382 $this->set_permalink_structure( '/%year%/%postname%/' ); 404 383 405 384 $p = $this->factory->post->create( array( … … 415 394 */ 416 395 public function test_get_sample_permalink_should_avoid_slugs_that_would_create_clashes_with_day_archives() { 417 global $wp_rewrite; 418 $wp_rewrite->init(); 419 $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%postname%/' ); 420 $wp_rewrite->flush_rules(); 396 $this->set_permalink_structure( '/%year%/%monthnum%/%postname%/' ); 421 397 422 398 $p = $this->factory->post->create( array( … … 432 408 */ 433 409 public function test_get_sample_permalink_should_iterate_slug_suffix_when_a_date_conflict_is_found() { 434 global $wp_rewrite; 435 $wp_rewrite->init(); 436 $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%postname%/' ); 437 $wp_rewrite->flush_rules(); 410 $this->set_permalink_structure( '/%year%/%monthnum%/%postname%/' ); 438 411 439 412 $this->factory->post->create( array( … … 453 426 */ 454 427 public function test_get_sample_permalink_should_ignore_potential_day_conflicts_for_invalid_day() { 455 global $wp_rewrite; 456 $wp_rewrite->init(); 457 $wp_rewrite->set_permalink_structure( '/%year%/%monthnum%/%postname%/' ); 458 $wp_rewrite->flush_rules(); 428 $this->set_permalink_structure( '/%year%/%monthnum%/%postname%/' ); 459 429 460 430 $p = $this->factory->post->create( array( … … 470 440 */ 471 441 public function test_get_sample_permalink_should_allow_daylike_slugs_if_permastruct_does_not_cause_an_archive_conflict() { 472 global $wp_rewrite; 473 $wp_rewrite->init(); 474 $wp_rewrite->set_permalink_structure( '/%year%/%month%/%day%/%postname%/' ); 475 $wp_rewrite->flush_rules(); 442 $this->set_permalink_structure( '/%year%/%month%/%day%/%postname%/' ); 476 443 477 444 $p = $this->factory->post->create( array(
Note: See TracChangeset
for help on using the changeset viewer.