Ticket #35246: 35246.diff
| File 35246.diff, 1.2 KB (added by , 10 years ago) |
|---|
-
src/wp-admin/includes/post.php
687 687 } 688 688 689 689 if ( !empty ( $content ) ) { 690 $query .= ' AND post_content = %s';690 $query .= ' AND post_content = %s'; 691 691 $args[] = $post_content; 692 692 } 693 693 -
tests/phpunit/tests/admin/includesPost.php
481 481 $this->assertSame( $p, post_exists( $title, $content ) ); 482 482 } 483 483 484 /** 485 * @ticket 35246 486 */ 487 public function test_post_exists_should_match_content_with_no_title() { 488 $title = ''; 489 $content = 'Foo Bar Baz'; 490 $p = self::factory()->post->create( array( 491 'post_title' => $title, 492 'post_content' => $content, 493 ) ); 494 495 $this->assertSame( $p, post_exists( $title, $content ) ); 496 } 497 484 498 public function test_post_exists_should_not_match_when_nonempty_content_doesnt_match() { 485 499 $title = 'Foo Bar'; 486 500 $content = 'Foo Bar Baz';