function HtmxUtilitiesTest::testApplyToWithKey

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Htmx/HtmxUtilitiesTest.php \Drupal\Tests\Core\Htmx\HtmxUtilitiesTest::testApplyToWithKey()

Test ::applyTo with attribute key.

File

core/tests/Drupal/Tests/Core/Htmx/HtmxUtilitiesTest.php, line 115

Class

HtmxUtilitiesTest
Test all Htmx public utility methods.

Namespace

Drupal\Tests\Core\Htmx

Code

public function testApplyToWithKey() : void {
  $render = [];
  $this->htmx
    ->applyTo($render, '#wrapper_attributes');
  $this->assertTrue(isset($render['#wrapper_attributes']));
  $this->assertEquals(2, count($render['#wrapper_attributes']));
}

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