function ActiveLinkResponseFilterTest::testSetLinkActiveClass

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php \Drupal\Tests\Core\EventSubscriber\ActiveLinkResponseFilterTest::testSetLinkActiveClass()
  2. 8.9.x core/tests/Drupal/Tests/Core/EventSubscriber/ActiveLinkResponseFilterTest.php \Drupal\Tests\Core\EventSubscriber\ActiveLinkResponseFilterTest::testSetLinkActiveClass()
  3. 10 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 404

Class

ActiveLinkResponseFilterTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21EventSubscriber%21ActiveLinkResponseFilter.php/class/ActiveLinkResponseFilter/11.x" title="Subscribes to filter HTML responses, to set attributes on active links." class="local">\Drupal\Core\EventSubscriber\ActiveLinkResponseFilter</a> @group EventSubscriber

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.