You are here

protected function DeployWebTestCase::editEndpoint in Deploy - Content Staging 7.3

Same name and namespace in other branches
  1. 7.2 deploy.test \DeployWebTestCase::editEndpoint()

Edit an endpoint to make it point to a specific site in this test environment.

This is needed in order for deployments to be able to reach sites in this test environment.

1 call to DeployWebTestCase::editEndpoint()
DeployWebTestCase::setUp in ./deploy.test
Set up all sites.

File

./deploy.test, line 194
Deployment tests.

Class

DeployWebTestCase
Helper class.

Code

protected function editEndpoint($endpoint_name, $site_key) {
  $endpoint = deploy_endpoint_load($endpoint_name);
  $endpoint->authenticator_config = array(
    'username' => $GLOBALS['endpoint_user']->name,
    'password' => $GLOBALS['endpoint_user']->pass_raw,
  );
  $endpoint->service_config['url'] = url('api', array(
    'absolute' => TRUE,
  ));
  $user_agent = drupal_generate_test_ua($this->sites[$site_key]->databasePrefix);
  $endpoint->service_config['headers'] = array(
    'User-Agent' => $user_agent,
  );
  ctools_export_crud_save('deploy_endpoints', $endpoint);
}