Changeset 57133
- Timestamp:
- 11/23/2023 02:39:16 PM (19 months ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/spy-rest-server.php
r55027 r57133 26 26 */ 27 27 public function __call( $method, $args ) { 28 if ( ! method_exists( $this, $method ) ) { 29 throw new Error( sprintf( 'Call to undefined method %s::%s()', get_class( $this ), $method ) ); 30 } 31 28 32 return call_user_func_array( array( $this, $method ), $args ); 29 33 } -
trunk/tests/phpunit/tests/rest-api.php
r56566 r57133 30 30 public function filter_wp_rest_server_class( $class_name ) { 31 31 return 'Spy_REST_Server'; 32 } 33 34 public function test_rest_get_server_fails_with_undefined_method() { 35 $this->expectException( Error::class ); 36 rest_get_server()->does_not_exist(); 32 37 } 33 38
Note: See TracChangeset
for help on using the changeset viewer.