Changeset 55562 for trunk/tests/phpunit/tests/rest-api.php
- Timestamp:
- 03/19/2023 12:03:30 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/rest-api.php
r55116 r55562 26 26 remove_filter( 'wp_rest_server_class', array( $this, 'filter_wp_rest_server_class' ) ); 27 27 parent::tear_down(); 28 } 29 30 public function filter_wp_rest_server_class( $class_name ) { 31 return 'Spy_REST_Server'; 28 32 } 29 33 … … 823 827 } 824 828 825 public function jsonp_callback_provider() { 829 /** 830 * @dataProvider data_jsonp_callback_check 831 */ 832 public function test_jsonp_callback_check( $callback, $expected ) { 833 $this->assertSame( $expected, wp_check_jsonp_callback( $callback ) ); 834 } 835 836 public function data_jsonp_callback_check() { 826 837 return array( 827 838 // Standard names. … … 842 853 843 854 /** 844 * @dataProvider jsonp_callback_provider845 */ 846 public function test_ jsonp_callback_check( $callback, $expected ) {847 $this->assert Same( $expected, wp_check_jsonp_callback( $callback) );848 } 849 850 public function rest_date_provider() {855 * @dataProvider data_rest_parse_date 856 */ 857 public function test_rest_parse_date( $date, $expected ) { 858 $this->assertEquals( $expected, rest_parse_date( $date ) ); 859 } 860 861 public function data_rest_parse_date() { 851 862 return array( 852 863 // Valid dates with timezones. … … 874 885 875 886 /** 876 * @dataProvider rest_date_provider877 */ 878 public function test_rest_parse_date ( $date, $expected ) {879 $this->assert Equals( $expected, rest_parse_date( $date ) );880 } 881 882 public function rest_date_force_utc_provider() {887 * @dataProvider data_rest_parse_date_force_utc 888 */ 889 public function test_rest_parse_date_force_utc( $date, $expected ) { 890 $this->assertSame( $expected, rest_parse_date( $date, true ) ); 891 } 892 893 public function data_rest_parse_date_force_utc() { 883 894 return array( 884 895 // Valid dates with timezones. … … 903 914 array( '2017', false ), 904 915 ); 905 }906 907 /**908 * @dataProvider rest_date_force_utc_provider909 */910 public function test_rest_parse_date_force_utc( $date, $expected ) {911 $this->assertSame( $expected, rest_parse_date( $date, true ) );912 }913 914 public function filter_wp_rest_server_class( $class_name ) {915 return 'Spy_REST_Server';916 916 } 917 917 … … 1784 1784 1785 1785 /** 1786 * @dataProvider rest_ensure_response_data_provider1786 * @dataProvider data_rest_ensure_response_returns_instance_of_wp_rest_response 1787 1787 * 1788 1788 * @param mixed $response The response passed to rest_ensure_response(). … … 1800 1800 * @return array 1801 1801 */ 1802 public function rest_ensure_response_data_provider() {1802 public function data_rest_ensure_response_returns_instance_of_wp_rest_response() { 1803 1803 return array( 1804 1804 array( null, null ),
Note: See TracChangeset
for help on using the changeset viewer.