Changeset 34802 for trunk/tests/phpunit/tests/admin/includesPost.php
- Timestamp:
- 10/03/2015 05:14:12 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesPost.php
r34680 r34802 254 254 global $wp_rewrite; 255 255 256 $old_permalink_structure = get_option( 'permalink_structure' );257 256 $permalink_structure = '%postname%'; 258 257 $wp_rewrite->set_permalink_structure( "/$permalink_structure/" ); … … 266 265 267 266 $this->assertSame( $expected, $found[0] ); 268 269 $wp_rewrite->set_permalink_structure( $old_permalink_structure );270 flush_rewrite_rules();271 267 } 272 268 … … 276 272 */ 277 273 public function test_get_sample_permalink_html_should_use_default_permalink_for_view_post_link_when_pretty_permalinks_are_disabled() { 278 global $wp_rewrite;279 $old_permalink_structure = get_option( 'permalink_structure' );280 $wp_rewrite->set_permalink_structure( '' );281 flush_rewrite_rules();282 283 274 wp_set_current_user( $this->factory->user->create( array( 'role' => 'administrator' ) ) ); 284 275 … … 288 279 $found = get_sample_permalink_html( $p ); 289 280 $this->assertContains( 'href="' . get_option( 'home' ) . '/?p=' . $p . '"', $found ); 290 291 $wp_rewrite->set_permalink_structure( $old_permalink_structure );292 flush_rewrite_rules();293 281 } 294 282 … … 299 287 public function test_get_sample_permalink_html_should_use_pretty_permalink_for_view_post_link_when_pretty_permalinks_are_enabled() { 300 288 global $wp_rewrite; 301 $old_permalink_structure = get_option( 'permalink_structure' );302 289 $permalink_structure = '%postname%'; 303 290 $wp_rewrite->set_permalink_structure( "/$permalink_structure/" ); … … 312 299 $post = get_post( $p ); 313 300 $this->assertContains( 'href="' . get_option( 'home' ) . "/" . $post->post_name . '/"', $found ); 314 315 $wp_rewrite->set_permalink_structure( $old_permalink_structure );316 flush_rewrite_rules();317 301 } 318 302 … … 323 307 public function test_get_sample_permalink_html_should_use_correct_permalink_for_view_post_link_when_changing_slug() { 324 308 global $wp_rewrite; 325 $old_permalink_structure = get_option( 'permalink_structure' );326 309 $permalink_structure = '%postname%'; 327 310 $wp_rewrite->set_permalink_structure( "/$permalink_structure/" ); … … 358 341 359 342 $this->assertContains( 'href="' . esc_url( $preview_link ) . '"', $found, $message ); 360 361 $wp_rewrite->set_permalink_structure( $old_permalink_structure );362 flush_rewrite_rules();363 343 } 364 344 … … 378 358 $found = get_sample_permalink( $p ); 379 359 $this->assertEquals( '2015-2', $found[1] ); 380 381 $wp_rewrite->set_permalink_structure( '' );382 flush_rewrite_rules();383 360 } 384 361 … … 398 375 $found = get_sample_permalink( $p ); 399 376 $this->assertEquals( '2015', $found[1] ); 400 401 $wp_rewrite->set_permalink_structure( '' );402 flush_rewrite_rules();403 377 } 404 378 … … 418 392 $found = get_sample_permalink( $p ); 419 393 $this->assertEquals( '11-2', $found[1] ); 420 421 $wp_rewrite->set_permalink_structure( '' );422 flush_rewrite_rules();423 394 } 424 395 … … 438 409 $found = get_sample_permalink( $p ); 439 410 $this->assertEquals( '13', $found[1] ); 440 441 $wp_rewrite->set_permalink_structure( '' );442 flush_rewrite_rules();443 411 } 444 412 … … 458 426 $found = get_sample_permalink( $p ); 459 427 $this->assertEquals( '30-2', $found[1] ); 460 461 $wp_rewrite->set_permalink_structure( '' );462 flush_rewrite_rules();463 428 } 464 429 … … 482 447 $found = get_sample_permalink( $p ); 483 448 $this->assertEquals( '30-3', $found[1] ); 484 485 $wp_rewrite->set_permalink_structure( '' );486 flush_rewrite_rules();487 449 } 488 450 … … 502 464 $found = get_sample_permalink( $p ); 503 465 $this->assertEquals( '32', $found[1] ); 504 505 $wp_rewrite->set_permalink_structure( '' );506 flush_rewrite_rules();507 466 } 508 467 … … 522 481 $found = get_sample_permalink( $p ); 523 482 $this->assertEquals( '30', $found[1] ); 524 525 $wp_rewrite->set_permalink_structure( '' );526 flush_rewrite_rules();527 483 } 528 484
Note: See TracChangeset
for help on using the changeset viewer.