You are here

protected function EndpointAccessibilityRequirement::testWebhookEndpoint in Acquia Content Hub 8

Test the webhook endpoint.

1 call to EndpointAccessibilityRequirement::testWebhookEndpoint()
EndpointAccessibilityRequirement::verify in acquia_contenthub_diagnostic/src/Plugin/ContentHubRequirement/EndpointAccessibilityRequirement.php
Verify the accessibility of the content hub endpoints.

File

acquia_contenthub_diagnostic/src/Plugin/ContentHubRequirement/EndpointAccessibilityRequirement.php, line 92

Class

EndpointAccessibilityRequirement
Defines an endpoint accessibility requirement.

Namespace

Drupal\acquia_contenthub_diagnostic\Plugin\ContentHubRequirement

Code

protected function testWebhookEndpoint() {
  $endpoint_name = 'Webhook Endpoint';
  $endpoint_url = '/acquia-contenthub/webhook';
  $client = \Drupal::httpClient();
  $response = $client
    ->get($this->domain . $endpoint_url, static::REQUEST_OPTIONS);
  $status_code = $response
    ->getStatusCode();
  $this->description .= $this
    ->parseStatusCode($status_code, $endpoint_name, $endpoint_url);
}