You are here

protected function ServicesRESTServerTests::getDefaultFactoryArguments in Services 7.3

6 calls to ServicesRESTServerTests::getDefaultFactoryArguments()
ServicesRESTServerTests::testGetControllerArgumentsFromSources in servers/rest_server/tests/ServicesRESTServerTests.test
Test for getControllerArgumentsFromSources() method.
ServicesRESTServerTests::testGetResourceName in servers/rest_server/tests/ServicesRESTServerTests.test
Test method getResourceName().
ServicesRESTServerTests::testGetResponseFormatter in servers/rest_server/tests/ServicesRESTServerTests.test
Test method getResponseFormatter().
ServicesRESTServerTests::testParseRequestBody in servers/rest_server/tests/ServicesRESTServerTests.test
Test for parseRequestBody() method.
ServicesRESTServerTests::testRender in servers/rest_server/tests/ServicesRESTServerTests.test
Test for render() method.

... See full list

File

servers/rest_server/tests/ServicesRESTServerTests.test, line 391

Class

ServicesRESTServerTests
Unit tests for RESTServer class.

Code

protected function getDefaultFactoryArguments() {
  $context_data = array(
    'get' => array(
      'q' => 'rest/node/1.xml',
    ),
    'server' => array(),
    'post' => array(),
    'request_body' => '',
  );
  $formatters = array(
    'xml' => array(
      'mime types' => array(
        'application/xml',
        'text/xml',
      ),
      'formatter class' => 'ServicesXMLFormatter',
    ),
    'json' => array(
      'mime types' => array(
        'application/json',
      ),
      'formatter class' => 'ServicesJSONFormatter',
    ),
  );
  $factory_args = array(
    'endpoint_path' => 'rest',
    'context_data' => $context_data,
    'formatters' => $formatters,
  );
  return $factory_args;
}