function HtmxAttributesTest::testHxRequest
Test request method.
File
-
core/
tests/ Drupal/ Tests/ Core/ Htmx/ HtmxAttributesTest.php, line 277
Class
- HtmxAttributesTest
- Test all attribute-related Htmx public methods.
Namespace
Drupal\Tests\Core\HtmxCode
public function testHxRequest() : void {
$values = [
'timeout' => 100,
'credentials' => FALSE,
];
$this->htmx
->request($values);
$render = $this->apply();
$this->assertTrue(isset($render['#attributes']['data-hx-request']));
$this->assertEquals('{"timeout":100,"credentials":false}', $render['#attributes']['data-hx-request']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.