function HtmxAttributesTest::testHxOn
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Htmx/HtmxAttributesTest.php \Drupal\Tests\Core\Htmx\HtmxAttributesTest::testHxOn()
Test on method.
Attributes
#[DataProvider('hxOnDataProvider')]
File
-
core/
tests/ Drupal/ Tests/ Core/ Htmx/ HtmxAttributesTest.php, line 60
Class
- HtmxAttributesTest
- Test all attribute-related Htmx public methods.
Namespace
Drupal\Tests\Core\HtmxCode
public function testHxOn(string|array $event, string $action, string $name, string $expected) : void {
$this->htmx
->on($event, $action);
$render = $this->apply();
$this->assertTrue(isset($render['#attributes'][$name]));
$this->assertEquals($expected, $render['#attributes'][$name]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.