function ContextualUnitTest::testContextualLinksToId

Same name in other branches
  1. 9 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. 11.x core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php \Drupal\Tests\contextual\Kernel\ContextualUnitTest::testContextualLinksToId()

Tests _contextual_links_to_id().

File

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

Class

ContextualUnitTest
Tests all edge cases of converting from #contextual_links to ids and vice versa.

Namespace

Drupal\Tests\contextual\Kernel

Code

public function testContextualLinksToId() {
    $tests = $this->_contextual_links_id_testcases();
    foreach ($tests as $test) {
        $this->assertIdentical(_contextual_links_to_id($test['links']), $test['id']);
    }
}

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