function ContextualUnitTest::testContextualLinksToId

Same name and namespace in other branches
  1. 11.x core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php \Drupal\Tests\contextual\Kernel\ContextualUnitTest::testContextualLinksToId()
  2. 10 core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php \Drupal\Tests\contextual\Kernel\ContextualUnitTest::testContextualLinksToId()
  3. 9 core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php \Drupal\Tests\contextual\Kernel\ContextualUnitTest::testContextualLinksToId()
  4. 8.9.x core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php \Drupal\Tests\contextual\Kernel\ContextualUnitTest::testContextualLinksToId()

Tests the conversion from contextual links to IDs.

@legacy-covers ::_contextual_links_to_id

Attributes

#[DataProvider('contextualLinksDataProvider')]

Parameters

array $links: The #contextual_links property value array.

string $id: The serialized representation of the passed links.

string $theme: The name of the theme the placeholder should pass to the controller.

File

core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php, line 120

Class

ContextualUnitTest
Tests edge cases for converting between contextual links and IDs.

Namespace

Drupal\Tests\contextual\Kernel

Code

public function testContextualLinksToId(array $links, string $id, string $theme) : void {
  $this->assertSame($id, $this->container
    ->get(ContextualLinksSerializer::class)
    ->linksToId($links));
}

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