Make WordPress Core


Ignore:
Timestamp:
07/18/2021 01:45:57 PM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

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

    r51397 r51452  
    1111 */
    1212class WP_Test_REST_Controller extends WP_Test_REST_TestCase {
     13
     14    public static function wpSetUpBeforeClass( WP_UnitTest_Factory $factory ) {
     15        // Load the WP_REST_Test_Controller class if not already loaded.
     16        require_once __DIR__ . '/rest-test-controller.php';
     17    }
    1318
    1419    public function setUp() {
Note: See TracChangeset for help on using the changeset viewer.