| 368 | * @ticket 30910 |
| 369 | * @ticket 18306 |
| 370 | */ |
| 371 | public function test_get_sample_permalink_html_should_use_preview_links_for_draft_and_pending_posts_with_no_post_name() { |
| 372 | $this->set_permalink_structure( '/%postname%/' ); |
| 373 | |
| 374 | wp_set_current_user( self::$admin_id ); |
| 375 | |
| 376 | $future_date = date( 'Y-m-d H:i:s', time() + 100 ); |
| 377 | $p = self::factory()->post->create( array( 'post_status' => 'pending', 'post_name' => '', 'post_date' => $future_date ) ); |
| 378 | |
| 379 | $found = get_sample_permalink_html( $p ); |
| 380 | $post = get_post( $p ); |
| 381 | $this->assertContains( 'href="' . esc_url( get_preview_post_link( $post ) ), $found ); |
| 382 | } |
| 383 | |
| 384 | /** |