Changeset 11185
- Timestamp:
- 08/18/2021 03:23:40 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/patterns/1.0/tests/test-index.php
r11184 r11185 25 25 } 26 26 27 /** 28 * Asserts that the results contain the search term. 29 * 30 * @param array $patterns 31 * @param string $search_term 32 */ 27 33 public function assertAllPatternsMatchSearchTerm( $patterns, $search_term ) { 28 34 $all_patterns_include_query = true; 35 if ( false !== strpos( $search_term, ' ' ) ) { 36 $this->markTestIncomplete( "This doesn't support phrase-matching quoted terms yet." ); 37 } 29 38 30 39 foreach ( $patterns as $pattern ) { … … 174 183 */ 175 184 public function test_search_patterns( $search_term, $locale, $match_expected, $expected_post_ids ) : void { 176 // wrap term in double quotes to match exact phrase. 177 $response = send_request( '/patterns/1.0/?&search="' . $search_term . '"&pattern-keywords=11&locale=' . $locale ); 185 $response = send_request( "/patterns/1.0/?search=$search_term&pattern-keywords=11&locale=$locale" ); 178 186 179 187 if ( $match_expected ) { … … 202 210 // Should find posts that have the term in the title, but _not_ in the description. 203 211 'match title only' => array( 204 'search_term' => 'side by side',212 'search_term' => 'side', 205 213 'locale' => 'en_US', 206 214 'match_expected' => true, … … 210 218 // Should find posts that have the term in the description, but _not_ in the title. 211 219 'match description only' => array( 212 'search_term' => 'quote on top',220 'search_term' => 'quote', 213 221 'locale' => 'en_US', 214 222 'match_expected' => true, … … 270 278 // @link https://translate.wordpress.org/projects/patterns/core/ 271 279 "untranslated locales should have en_US posts as a fallback" => array( 272 'search_term' => 'offset images', // Post ID 2226.280 'search_term' => 'offset', 273 281 'locale' => 'la', 274 282 'match_expected' => true,
Note: See TracChangeset
for help on using the changeset viewer.