function HtmxRequestInfoTest::testGetHtmxTrigger
Tests the getHtmxTrigger method.
File
-
core/
tests/ Drupal/ Tests/ Core/ Htmx/ HtmxRequestInfoTest.php, line 110
Class
- HtmxRequestInfoTest
- Test all HtmxRequestInfoTrait methods.
Namespace
Drupal\Tests\Core\HtmxCode
public function testGetHtmxTrigger() : void {
// Test with the header not present.
$this->assertEquals('', $this->getHtmxTrigger());
// Test with the header present.
$this->request->headers
->set('HX-Trigger', 'submit-button');
$this->assertEquals('submit-button', $this->getHtmxTrigger());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.