Changeset 11106
- Timestamp:
- 07/08/2021 12:10:57 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/patterns/1.0/tests/test-index.php
r11105 r11106 153 153 */ 154 154 public function test_search_patterns( $search_term, $match_expected ) : void { 155 $response = send_request( '/patterns/1.0/?&search=' . $search_term . '&pattern-keywords=11&locale=en_US' ); 155 // wrap term in double quotes to match exact phrase. 156 $response = send_request( '/patterns/1.0/?&search="' . $search_term . '"&pattern-keywords=11&locale=en_US' ); 156 157 157 158 if ( $match_expected ) { … … 163 164 foreach ( $patterns as $pattern ) { 164 165 $match_in_title = stripos( $pattern->title->rendered, $search_term ); 165 $match_in_description = stripos( $pattern->meta->wpop_description, $search_term ); ;166 167 if ( ! $match_in_title && !$match_in_description ) {166 $match_in_description = stripos( $pattern->meta->wpop_description, $search_term ); 167 168 if ( false === $match_in_title && false === $match_in_description ) { 168 169 $all_patterns_include_query = false; 169 170 break;
Note: See TracChangeset
for help on using the changeset viewer.