You are here

public function WebhooksTest::testEventReceive in Webhooks 8

Test incoming webhook.

@group dev

File

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

Class

WebhooksTest
Test description.

Namespace

Drupal\Tests\webhooks\Functional

Code

public function testEventReceive() {

  /** @var \Drupal\webhooks\Entity\WebhookConfig $webhook_config */
  $webhook_config = WebhookConfig::load(self::WEBHOOK_ID_OUTGOING);
  $webhook = new Webhook($this->payload);
  $this->webhookService
    ->send($webhook_config, $webhook);
  $webhook_received = $this->state
    ->get('onWebhookReceive');
  $this
    ->assertEqual($webhook_received, TRUE);
}