Make WordPress Core


Ignore:
Timestamp:
11/23/2023 02:39:16 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Tests: Avoid an infinite loop in Spy_REST_Server if a non-existing method is called.

Follow-up to [34928].

Props xknown, joemcgill.
Fixes #59601.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api.php

    r56566 r57133  
    3030        public function filter_wp_rest_server_class( $class_name ) {
    3131                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();
    3237        }
    3338
Note: See TracChangeset for help on using the changeset viewer.