- Timestamp:
- 07/19/2021 02:00:11 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api/rest-categories-controller.php
r51461 r51462 279 279 $data = $response->get_data(); 280 280 $first_error = array_shift( $data['data']['params'] ); 281 $this->assert Contains( 'page must be greater than or equal to 1', $first_error );281 $this->assertStringContainsString( 'page must be greater than or equal to 1', $first_error ); 282 282 } 283 283 … … 628 628 ); 629 629 $this->assertStringNotContainsString( 'rel="prev"', $headers['Link'] ); 630 $this->assert Contains( '<' . $next_link . '>; rel="next"', $headers['Link'] );630 $this->assertStringContainsString( '<' . $next_link . '>; rel="next"', $headers['Link'] ); 631 631 632 632 // 3rd page. … … 647 647 rest_url( 'wp/v2/categories' ) 648 648 ); 649 $this->assert Contains( '<' . $prev_link . '>; rel="prev"', $headers['Link'] );649 $this->assertStringContainsString( '<' . $prev_link . '>; rel="prev"', $headers['Link'] ); 650 650 $next_link = add_query_arg( 651 651 array( … … 654 654 rest_url( 'wp/v2/categories' ) 655 655 ); 656 $this->assert Contains( '<' . $next_link . '>; rel="next"', $headers['Link'] );656 $this->assertStringContainsString( '<' . $next_link . '>; rel="next"', $headers['Link'] ); 657 657 658 658 // Last page. … … 670 670 rest_url( 'wp/v2/categories' ) 671 671 ); 672 $this->assert Contains( '<' . $prev_link . '>; rel="prev"', $headers['Link'] );672 $this->assertStringContainsString( '<' . $prev_link . '>; rel="prev"', $headers['Link'] ); 673 673 $this->assertStringNotContainsString( 'rel="next"', $headers['Link'] ); 674 674 … … 687 687 rest_url( 'wp/v2/categories' ) 688 688 ); 689 $this->assert Contains( '<' . $prev_link . '>; rel="prev"', $headers['Link'] );689 $this->assertStringContainsString( '<' . $prev_link . '>; rel="prev"', $headers['Link'] ); 690 690 $this->assertStringNotContainsString( 'rel="next"', $headers['Link'] ); 691 691 } … … 811 811 $headers = $response->get_headers(); 812 812 $data = $response->get_data(); 813 $this->assert Contains( '/wp/v2/categories/' . $data['id'], $headers['Location'] );813 $this->assertStringContainsString( '/wp/v2/categories/' . $data['id'], $headers['Location'] ); 814 814 $this->assertSame( 'My Awesome Term', $data['name'] ); 815 815 $this->assertSame( 'This term is so awesome.', $data['description'] ); … … 1225 1225 1226 1226 $this->assertSameSets( $relations, array_keys( $links ) ); 1227 $this->assert Contains( 'wp/v2/taxonomies/' . $term->taxonomy, $links['about'][0]['href'] );1227 $this->assertStringContainsString( 'wp/v2/taxonomies/' . $term->taxonomy, $links['about'][0]['href'] ); 1228 1228 $this->assertSame( add_query_arg( 'categories', $term->term_id, rest_url( 'wp/v2/posts' ) ), $links['https://api.w.org/post_type'][0]['href'] ); 1229 1229 }
Note: See TracChangeset
for help on using the changeset viewer.