function HtmxRequestInfoTest::testIsHtmxBoosted

Tests the isHtmxBoosted method.

File

core/tests/Drupal/Tests/Core/Htmx/HtmxRequestInfoTest.php, line 50

Class

HtmxRequestInfoTest
Test all HtmxRequestInfoTrait methods.

Namespace

Drupal\Tests\Core\Htmx

Code

public function testIsHtmxBoosted() : void {
  // Test with the header not present.
  $this->assertFalse($this->isHtmxBoosted());
  // Test with the header present.
  $this->request->headers
    ->set('HX-Boosted', 'true');
  $this->assertTrue($this->isHtmxBoosted());
}

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