You are here

public function WebhooksTest::testPayload in Webhooks 8

Test webhook payload.

File

tests/src/Functional/WebhooksTest.php, line 219

Class

WebhooksTest
Test description.

Namespace

Drupal\Tests\webhooks\Functional

Code

public function testPayload() {
  $webhook_config = WebhookConfig::load(self::WEBHOOK_ID_OUTGOING);
  $webhook = new Webhook($this->payload);
  $this->webhookService
    ->send($webhook_config, $webhook);

  /** @var \Drupal\webhooks\Webhook $webhook_received */
  $webhook_received = $this->state
    ->get('onWebhookReceive_webhook');
  $this
    ->assertEqual($webhook_received
    ->getPayload(), $this->payload);
}