Changeset 14026 for trunk/tests/phpunit/assets/bp-rest-api-controllers.php
- Timestamp:
- 09/27/2024 09:11:27 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/assets/bp-rest-api-controllers.php
r13414 r14026 1 <?php2 /**3 * BP REST Controllers' mocks4 */5 6 class BP_REST_Mock_Class {7 public function __construct() {}8 9 public function register_routes( $controller = '' ) {10 array_push( buddypress()->unit_test_rest->controllers, $controller );11 }12 }13 14 /**15 * BP Member Cover Image REST Controller's mock.16 */17 #[AllowDynamicProperties]18 class BP_REST_Attachments_Member_Cover_Endpoint extends BP_REST_Mock_Class {19 public function __construct() {20 $this->namespace = bp_rest_namespace() . '/' . bp_rest_version();21 $this->rest_base = 'members';22 }23 24 public function register_routes( $controller = '' ) {25 parent::register_routes( 'BP_REST_Attachments_Member_Cover_Endpoint' );26 }27 }28 29 /**30 * BP Member Avatar REST Controller's mock.31 */32 #[AllowDynamicProperties]33 class BP_REST_Attachments_Member_Avatar_Endpoint extends BP_REST_Mock_Class {34 public function __construct() {35 $this->namespace = bp_rest_namespace() . '/' . bp_rest_version();36 $this->rest_base = 'members';37 }38 39 public function register_routes( $controller = '' ) {40 parent::register_routes( 'BP_REST_Attachments_Member_Avatar_Endpoint' );41 }42 }43 44 /**45 * BP Components REST Controller's mock.46 */47 #[AllowDynamicProperties]48 class BP_REST_Components_Endpoint extends BP_REST_Mock_Class {49 public function __construct() {50 $this->namespace = bp_rest_namespace() . '/' . bp_rest_version();51 $this->rest_base = 'components';52 }53 54 public function register_routes( $controller = '' ) {55 parent::register_routes( 'BP_REST_Components_Endpoint' );56 }57 }58 59 /**60 * BP Members REST Controller's mock.61 */62 #[AllowDynamicProperties]63 class BP_REST_Members_Endpoint extends BP_REST_Mock_Class {64 public function __construct() {65 $this->namespace = bp_rest_namespace() . '/' . bp_rest_version();66 $this->rest_base = 'members';67 }68 69 public function register_routes( $controller = '' ) {70 parent::register_routes( 'BP_REST_Members_Endpoint' );71 }72 }
Note: See TracChangeset
for help on using the changeset viewer.