public function ServicesResourceDisabledTest::saveNewEndpoint in Services 7.3
Save a new endpoint without any resources enabled. This is a method from ServicesWebTestCase that has been modified.
Overrides ServicesWebTestCase::saveNewEndpoint
1 call to ServicesResourceDisabledTest::saveNewEndpoint()
- ServicesResourceDisabledTest::setUp in tests/
functional/ ServicesResourceDisabledTests.test - Sets up a Drupal site for running functional and integration tests.
File
- tests/
functional/ ServicesResourceDisabledTests.test, line 46 - Contains tests when a resource is disabled.
Class
- ServicesResourceDisabledTest
- Try to make a request to a disabled resource.
Code
public function saveNewEndpoint() {
$edit = $this
->populateEndpointFAPI();
$endpoint = new stdClass();
$endpoint->disabled = FALSE;
/* Edit this to true to make a default endpoint disabled initially */
$endpoint->api_version = 3;
$endpoint->name = $edit['name'];
$endpoint->server = $edit['server'];
$endpoint->path = $edit['path'];
$endpoint->authentication = array(
'services' => 'services',
);
$endpoint->server_settings = array(
'formatters' => array(
'json' => TRUE,
'bencode' => TRUE,
'rss' => TRUE,
'plist' => TRUE,
'xmlplist' => TRUE,
'php' => TRUE,
'yaml' => TRUE,
'jsonp' => FALSE,
'xml' => FALSE,
),
'parsers' => array(
'application/x-yaml' => TRUE,
'application/json' => TRUE,
'application/vnd.php.serialized' => TRUE,
'application/plist' => TRUE,
'application/plist+xml' => TRUE,
'application/x-www-form-urlencoded' => TRUE,
'multipart/form-data' => TRUE,
),
);
$endpoint->debug = 1;
$endpoint->export_type = FALSE;
services_endpoint_save($endpoint);
$endpoint = services_endpoint_load($endpoint->name);
$this
->assertTrue($endpoint->name == $edit['name'], 'Endpoint successfully created');
return $endpoint;
}