class MockRESTServer in Services 7.3
Extend RESTServer to test protected methods.
Hierarchy
- class \RESTServer
- class \MockRESTServer
Expanded class hierarchy of MockRESTServer
File
- servers/
rest_server/ tests/ rest_server_mock_classes.inc, line 54
View source
class MockRESTServer extends RESTServer {
public function protectedGetControllerArgumentsFromSources($controller, $sources) {
return $this
->getControllerArgumentsFromSources($controller, $sources);
}
public function protectedRender($formatter, $result) {
return $this
->render($formatter, $result);
}
public function protectedGetResourceName() {
return $this
->getResourceName();
}
public function protectedGetResponseFormatter() {
return $this
->getResponseFormatter();
}
public function protectedResolveController($resource, &$operation) {
return $this
->resolveController($resource, $operation);
}
public function protectedParseRequestBody() {
return $this
->parseRequestBody();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MockRESTServer:: |
public | function | ||
MockRESTServer:: |
public | function | ||
MockRESTServer:: |
public | function | ||
MockRESTServer:: |
public | function | ||
MockRESTServer:: |
public | function | ||
MockRESTServer:: |
public | function | ||
RESTServer:: |
protected | property | ||
RESTServer:: |
protected | property | ||
RESTServer:: |
protected | property | ||
RESTServer:: |
protected | property | ||
RESTServer:: |
protected | property | ||
RESTServer:: |
protected | property | ||
RESTServer:: |
protected | function | Count possible numbers of 'path' arguments of the method. | |
RESTServer:: |
protected | function | Formats a status code and message for use as an HTTP header message. | |
RESTServer:: |
public | function | Canonical path is the url of the request without path of endpoint. | |
RESTServer:: |
protected | function | Explode canonical path to parts by '/'. | |
RESTServer:: |
protected | function | Controller is part of the resource like | |
RESTServer:: |
protected | function | Parses controller arguments from request | |
RESTServer:: |
protected | function | array $controller Controller definition array $sources Array of sources for arguments. Consists of following elements: 'path' - path requested 'params' - GET variables 'data' - parsed POST data 'headers' -… | |
RESTServer:: |
protected | function | Determine the request method | |
RESTServer:: |
protected | function | Example. We have endpoint with path 'rest'. Request is done to url /rest/node/1.php'. Name of resource in this case is 'node'. | |
RESTServer:: |
protected | function | Determine response format and mime type using headers to negotiate content types. | |
RESTServer:: |
protected | function | Retrieve formatter from URL. If format is in the path, we remove it from $canonical_path. | |
RESTServer:: |
protected | function | Response formatter is responsible for encoding the response. | |
RESTServer:: |
public | function | Handles the call to the REST server | |
RESTServer:: |
public | function | Set proper header and message in case of exception. | |
RESTServer:: |
protected | function | Matches a mime-type against a set of parsers. | |
RESTServer:: |
protected | function | Extract value of the header string. | |
RESTServer:: |
protected | function | Parse request body based on $_SERVER['CONTENT_TYPE'].s | |
RESTServer:: |
protected | function | ||
RESTServer:: |
protected | function | Render results using formatter. | |
RESTServer:: |
protected | function | Determine controller. | |
RESTServer:: |
protected | function | Wrapper around resolveController() to apply version. | |
RESTServer:: |
public | function | Formats a resource uri | |
RESTServer:: |
function | Constructor. Initialize properties. |