function ActiveLinkResponseFilterTest::testSetLinkActiveClass

Tests setLinkActiveClass().

@legacy-covers ::setLinkActiveClass

Attributes

#[DataProvider('providerTestSetLinkActiveClass')]

Parameters

string $html_markup: The original HTML markup.

string $current_path: The system path of the currently active page.

bool $is_front: Whether the current page is the front page (which implies the current path might also be <front>).

string $url_language: The language code of the current URL.

array $query: The query string for the current URL.

string $expected_html_markup: The expected updated HTML markup.

File

core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php, line 413

Class

ActiveLinkResponseFilterTest
Tests Drupal\Core\EventSubscriber\ActiveLinkResponseFilter.

Namespace

Drupal\Tests\Core\EventSubscriber

Code

public function testSetLinkActiveClass($html_markup, $current_path, $is_front, $url_language, array $query, $expected_html_markup) : void {
  $this->assertSame($expected_html_markup, ActiveLinkResponseFilter::setLinkActiveClass($html_markup, $current_path, $is_front, $url_language, $query));
}

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