function HtmxAttributesTest::testHxPushUrl

Test pushUrl method.

Attributes

#[DataProvider('booleanStringDataProvider')]

File

core/tests/Drupal/Tests/Core/Htmx/HtmxAttributesTest.php, line 167

Class

HtmxAttributesTest
Test all attribute-related Htmx public methods.

Namespace

Drupal\Tests\Core\Htmx

Code

public function testHxPushUrl(bool|Url $value, string $attributeValue) : void {
  $this->htmx
    ->pushUrl($value);
  $render = $this->apply();
  $this->assertTrue(isset($render['#attributes']['data-hx-push-url']));
  $this->assertEquals($attributeValue, $render['#attributes']['data-hx-push-url']);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.