You are here

public function ActiveLinkResponseFilterTest::testSetLinkActiveClass in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php \Drupal\Tests\Core\EventSubscriber\ActiveLinkResponseFilterTest::testSetLinkActiveClass()
  2. 9 core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php \Drupal\Tests\Core\EventSubscriber\ActiveLinkResponseFilterTest::testSetLinkActiveClass()

Tests setLinkActiveClass().

@dataProvider providerTestSetLinkActiveClass @covers ::setLinkActiveClass

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 410

Class

ActiveLinkResponseFilterTest
@coversDefaultClass \Drupal\Core\EventSubscriber\ActiveLinkResponseFilter @group EventSubscriber

Namespace

Drupal\Tests\Core\EventSubscriber

Code

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