mirror of
https://github.com/buddypress/buddypress.git
synced 2026-07-23 21:06:56 +08:00
For further details see this [https://wordpress.slack.com/archives/C02RQBYUG/p1572193392178200 discussion on slack] Props espellcaste, johnjamesjacoby See #8151 (Branch 5.0) git-svn-id: https://buddypress.svn.wordpress.org/branches/5.0@12484 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* BP REST Controllers' mocks
|
|
*/
|
|
|
|
class BP_REST_Mock_Class {
|
|
public function __construct() {}
|
|
|
|
public function register_routes( $controller = '' ) {
|
|
array_push( buddypress()->unit_test_rest->controllers, $controller );
|
|
}
|
|
}
|
|
|
|
/**
|
|
* BP Member Avatar REST Controller's mock.
|
|
*/
|
|
class BP_REST_Attachments_Member_Avatar_Endpoint extends BP_REST_Mock_Class {
|
|
public function __construct() {
|
|
$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
|
|
$this->rest_base = 'members';
|
|
}
|
|
|
|
public function register_routes( $controller = '' ) {
|
|
parent::register_routes( 'BP_REST_Attachments_Member_Avatar_Endpoint' );
|
|
}
|
|
}
|
|
|
|
/**
|
|
* BP Components REST Controller's mock.
|
|
*/
|
|
class BP_REST_Components_Endpoint extends BP_REST_Mock_Class {
|
|
public function __construct() {
|
|
$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
|
|
$this->rest_base = 'components';
|
|
}
|
|
|
|
public function register_routes( $controller = '' ) {
|
|
parent::register_routes( 'BP_REST_Components_Endpoint' );
|
|
}
|
|
}
|
|
|
|
/**
|
|
* BP Members REST Controller's mock.
|
|
*/
|
|
class BP_REST_Members_Endpoint extends BP_REST_Mock_Class {
|
|
public function __construct() {
|
|
$this->namespace = bp_rest_namespace() . '/' . bp_rest_version();
|
|
$this->rest_base = 'members';
|
|
}
|
|
|
|
public function register_routes( $controller = '' ) {
|
|
parent::register_routes( 'BP_REST_Members_Endpoint' );
|
|
}
|
|
}
|