Tests: Require the WP_REST_Test_Controller class in WP_REST_Controller tests.

This avoids a "Class not found" PHP fatal error when running these tests separately.

Follow-up to [38832].

See #53363.

git-svn-id: https://develop.svn.wordpress.org/trunk@51452 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2021-07-18 13:45:57 +00:00
parent 54c54f9a1e
commit f28e3d0b88

View File

@ -11,6 +11,11 @@
*/
class WP_Test_REST_Controller extends WP_Test_REST_TestCase {
public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
// Load the WP_REST_Test_Controller class if not already loaded.
require_once __DIR__ . '/rest-test-controller.php';
}
public function setUp() {
parent::setUp();
$this->request = new WP_REST_Request(