You are here

public function ReExportTest::createSignedRequest in Acquia Content Hub 8.2

Creates an test HMAC-Signed Request.

Return value

\Symfony\Component\HttpFoundation\Request The HMAC signed request.

1 call to ReExportTest::createSignedRequest()
ReExportTest::testReExport in modules/acquia_contenthub_publisher/tests/src/Kernel/EventSubscriber/HandleWebhook/ReExportTest.php
Tests entity updated status.

File

modules/acquia_contenthub_publisher/tests/src/Kernel/EventSubscriber/HandleWebhook/ReExportTest.php, line 252

Class

ReExportTest
Tests Re-export functionality from a Webhook.

Namespace

Drupal\Tests\acquia_contenthub_publisher\Kernel\EventSubscriber\HandleWebhook

Code

public function createSignedRequest() : Request {
  $request_global = Request::createFromGlobals();
  $request = $request_global
    ->duplicate(NULL, NULL, NULL, NULL, NULL, [
    'REQUEST_URI' => 'http://example.com/acquia-contenthub/webhook',
    'SERVER_NAME' => 'example.com',
  ]);

  // @codingStandardsIgnoreStart
  $header = 'acquia-http-hmac headers="X-Custom-Signer1;X-Custom-Signer2",id="e7fe97fa-a0c8-4a42-ab8e-2c26d52df059",nonce="a9938d07-d9f0-480c-b007-f1e956bcd027",realm="CIStore",signature="0duvqeMauat7pTULg3EgcSmBjrorrcRkGKxRDtZEa1c=",version="2.0"';

  // @codingStandardsIgnoreEnd
  $request->headers
    ->set('Authorization', $header);
  return $request;
}