public function WebhooksTest::testContentTypeXml in Webhooks 8
Test webhook content type XML.
File
- tests/
src/ Functional/ WebhooksTest.php, line 294
Class
- WebhooksTest
- Test description.
Namespace
Drupal\Tests\webhooks\FunctionalCode
public function testContentTypeXml() {
$webhook_config = WebhookConfig::load(self::WEBHOOK_ID_OUTGOING_XML);
$webhook = new Webhook($this->payload);
$webhook
->setContentType(WebhookConfig::CONTENT_TYPE_XML);
$this->webhookService
->send($webhook_config, $webhook);
/** @var \Drupal\webhooks\Webhook $webhook_received */
$webhook_received = $this->state
->get('onWebhookReceive_webhook');
$this
->assertEqual($webhook_received
->getContentType(), WebhookConfig::CONTENT_TYPE_XML);
}