function HtmxAttributesTest::testHxReplaceUrl

Test replaceUrl method.

Attributes

#[DataProvider('booleanStringDataProvider')]

File

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

Class

HtmxAttributesTest
Test all attribute-related Htmx public methods.

Namespace

Drupal\Tests\Core\Htmx

Code

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

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