Changeset 48937 for trunk/tests/phpunit/tests/query/search.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/query/search.php
r47122 r48937 51 51 52 52 $posts = $this->get_search_results( 'About' ); 53 $this->assert Equals( $post_id, reset( $posts )->ID );53 $this->assertSame( $post_id, reset( $posts )->ID ); 54 54 } 55 55 … … 58 58 $query = new WP_Query( array( 's' => 'This is a search term' ) ); 59 59 $this->assertNotEquals( explode( ' ', $terms ), $query->get( 'search_terms' ) ); 60 $this->assert Equals( array( 'search', 'term' ), $query->get( 'search_terms' ) );60 $this->assertSame( array( 'search', 'term' ), $query->get( 'search_terms' ) ); 61 61 } 62 62 … … 68 68 69 69 $this->assertNotEquals( array( 'search', 'term' ), $query->get( 'search_terms' ) ); 70 $this->assert Equals( array( 'This', 'is', 'search', 'term' ), $query->get( 'search_terms' ) );70 $this->assertSame( array( 'This', 'is', 'search', 'term' ), $query->get( 'search_terms' ) ); 71 71 } 72 72 … … 90 90 91 91 // By default, we can use the hyphen prefix to exclude results. 92 $this->assert Equals( array(), $this->get_search_results( $title ) );92 $this->assertSame( array(), $this->get_search_results( $title ) ); 93 93 94 94 // After we disable the feature using the filter, we should get the result. … … 96 96 $result = $this->get_search_results( $title ); 97 97 $post = array_pop( $result ); 98 $this->assert Equals( $post->ID, $post_id );98 $this->assertSame( $post->ID, $post_id ); 99 99 remove_filter( 'wp_query_search_exclusion_prefix', '__return_false' ); 100 100 } … … 117 117 $result = $this->get_search_results( $title ); 118 118 $post = array_pop( $result ); 119 $this->assert Equals( $post->ID, $post_id );119 $this->assertSame( $post->ID, $post_id ); 120 120 121 121 // After we change the prefix, the result should be excluded. … … 123 123 $found = $this->get_search_results( $title ); 124 124 remove_filter( 'wp_query_search_exclusion_prefix', array( $this, 'filter_search_exclusion_prefix_octothorpe' ) ); 125 $this->assert Equals( array(), $found );125 $this->assertSame( array(), $found ); 126 126 } 127 127
Note: See TracChangeset
for help on using the changeset viewer.