Changeset 34671
- Timestamp:
- 09/28/2015 10:06:15 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/post.js
r34670 r34671 742 742 revert_e = e.html(); 743 743 744 buttons.html('<button type="button" class="save button -small">'+postL10n.ok+'</button> <a class="cancel" href="#">'+postL10n.cancel+'</a>');744 buttons.html('<button type="button" class="save button button-small">'+postL10n.ok+'</button> <a class="cancel" href="#">'+postL10n.cancel+'</a>'); 745 745 buttons.children('.save').click(function() { 746 746 var new_slug = e.children('input').val(); -
trunk/tests/phpunit/tests/admin/includesPost.php
r33773 r34671 273 273 /** 274 274 * @ticket 30910 275 */ 276 public function test_get_sample_permalink_html_should_use_default_permalink_for_view_post_button_when_pretty_permalinks_are_disabled() { 275 * @ticket 18306 276 */ 277 public function test_get_sample_permalink_html_should_use_default_permalink_for_view_post_link_when_pretty_permalinks_are_disabled() { 277 278 global $wp_rewrite; 278 279 $old_permalink_structure = get_option( 'permalink_structure' ); … … 286 287 287 288 $found = get_sample_permalink_html( $p ); 288 $this->assertContains( "span id='view-post-btn'><a href='" . get_option( 'home' ) . "/?p=$p'", $found );289 $this->assertContains( 'href="' . get_option( 'home' ) . '/?p=' . $p . '"', $found ); 289 290 290 291 $wp_rewrite->set_permalink_structure( $old_permalink_structure ); … … 294 295 /** 295 296 * @ticket 30910 296 */ 297 public function test_get_sample_permalink_html_should_use_pretty_permalink_for_view_post_button_when_pretty_permalinks_are_enabled() { 297 * @ticket 18306 298 */ 299 public function test_get_sample_permalink_html_should_use_pretty_permalink_for_view_post_link_when_pretty_permalinks_are_enabled() { 298 300 global $wp_rewrite; 299 301 $old_permalink_structure = get_option( 'permalink_structure' ); … … 309 311 $found = get_sample_permalink_html( $p ); 310 312 $post = get_post( $p ); 311 $this->assertContains( "span id='view-post-btn'><a href='" . get_option( 'home' ) . "/" . $post->post_name . "/'", $found );313 $this->assertContains( 'href="' . get_option( 'home' ) . "/" . $post->post_name . '/"', $found ); 312 314 313 315 $wp_rewrite->set_permalink_structure( $old_permalink_structure ); … … 317 319 /** 318 320 * @ticket 32954 319 */ 320 public function test_get_sample_permalink_html_should_use_correct_permalink_for_view_post_button_when_changing_slug() { 321 * @ticket 18306 322 */ 323 public function test_get_sample_permalink_html_should_use_correct_permalink_for_view_post_link_when_changing_slug() { 321 324 global $wp_rewrite; 322 325 $old_permalink_structure = get_option( 'permalink_structure' ); … … 332 335 $found = get_sample_permalink_html( $p, null, 'new_slug' ); 333 336 $post = get_post( $p ); 334 $this->assertContains( "span id='view-post-btn'><a href='" . get_option( 'home' ) . "/" . $post->post_name . "/'", $found ); 337 $message = 'Published post'; 338 $this->assertContains( 'href="' . get_option( 'home' ) . "/" . $post->post_name . '/"', $found, $message ); 335 339 336 340 // Scheduled posts should use published permalink … … 340 344 $found = get_sample_permalink_html( $p, null, 'new_slug' ); 341 345 $post = get_post( $p ); 342 $this->assertContains( "span id='view-post-btn'><a href='" . get_option( 'home' ) . "/" . $post->post_name . "/'", $found ); 346 $message = 'Scheduled post'; 347 $this->assertContains( 'href="' . get_option( 'home' ) . "/" . $post->post_name . '/"', $found, $message ); 343 348 344 349 // Draft posts should use preview link … … 347 352 $found = get_sample_permalink_html( $p, null, 'new_slug' ); 348 353 $post = get_post( $p ); 354 $message = 'Draft post'; 349 355 350 356 $preview_link = get_permalink( $post->ID ); 351 357 $preview_link = add_query_arg( 'preview', 'true', $preview_link ); 352 358 353 $this->assertContains( "span id='view-post-btn'><a href='" . esc_url( $preview_link ) . "'", $found);359 $this->assertContains( 'href="' . esc_url( $preview_link ) . '"', $found, $message ); 354 360 355 361 $wp_rewrite->set_permalink_structure( $old_permalink_structure );
Note: See TracChangeset
for help on using the changeset viewer.