Changeset 11186
- Timestamp:
- 08/18/2021 03:23:46 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/api.wordpress.org/public_html/patterns/1.0/tests/test-index.php
r11185 r11186 18 18 19 19 $patterns = json_decode( $response->body ); 20 $this->assertIsArray( $patterns ); 20 21 $this->assertGreaterThan( 0, count( $patterns ) ); 21 22 $this->assertIsString( $patterns[0]->title->rendered ); … … 32 33 */ 33 34 public function assertAllPatternsMatchSearchTerm( $patterns, $search_term ) { 34 $all_patterns_include_query = true;35 35 if ( false !== strpos( $search_term, ' ' ) ) { 36 36 $this->markTestIncomplete( "This doesn't support phrase-matching quoted terms yet." ); … … 42 42 43 43 if ( false === $match_in_title && false === $match_in_description ) { 44 $all_patterns_include_query = false; 45 break; 44 $this->fail( "`$search_term` not found in `{$pattern->title->rendered}` pattern (ID {$pattern->id})" ); 46 45 } 47 46 } 48 47 49 $this->assertTrue( $all_patterns_include_query ); 48 $this->pass(); 49 } 50 51 /** 52 * PHPUnit provides `fail()`, but no equivalent for success. This makes calling code more obvious and self-documenting. 53 */ 54 public function pass() { 55 $this->assertTrue( true ); 50 56 } 51 57
Note: See TracChangeset
for help on using the changeset viewer.