diff --git tests/phpunit/tests/query/search.php tests/phpunit/tests/query/search.php
index 84ea960..0c23784 100644
|
|
|
class Tests_Query_Search extends WP_UnitTestCase { |
| 633 | 633 | public function filter_posts_search( $sql ) { |
| 634 | 634 | return $sql . ' /* posts_search */'; |
| 635 | 635 | } |
| | 636 | |
| | 637 | |
| | 638 | |
| | 639 | /** |
| | 640 | * @ticket 44737 |
| | 641 | */ |
| | 642 | public function test_post_status_should_consider_exclude_from_search() { |
| | 643 | //@TODO: сделать тест, который проверяет правильность метода |
| | 644 | |
| | 645 | $args = array( |
| | 646 | 'public' => true, |
| | 647 | 'exclude_from_search' => true, |
| | 648 | ); |
| | 649 | |
| | 650 | $post_status = 'status44737'; |
| | 651 | register_post_status( $post_status, $args ); |
| | 652 | |
| | 653 | $uniq_post = self::factory()->post->create( |
| | 654 | array( |
| | 655 | 'post_type' => 'post', |
| | 656 | 'post_status' => $post_status, |
| | 657 | 'post_title' => 'bar foo', |
| | 658 | 'post_content' => 'foo bar unique_word_44737', |
| | 659 | 'post_excerpt' => 'This post has foo', |
| | 660 | ) |
| | 661 | ); |
| | 662 | |
| | 663 | |
| | 664 | // Pass post_type a string value. |
| | 665 | $q = new WP_Query( |
| | 666 | array( |
| | 667 | 's' => 'unique_word_44737', |
| | 668 | 'fields' => 'ids', |
| | 669 | ) |
| | 670 | ); |
| | 671 | |
| | 672 | $this->assertNotEquals( array( $uniq_post ), $q->posts ); |
| | 673 | } |
| 636 | 674 | } |