function EntityUrlTest::registerLinkTemplate
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php \Drupal\Tests\Core\Entity\EntityUrlTest::registerLinkTemplate()
- 8.9.x core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php \Drupal\Tests\Core\Entity\EntityUrlTest::registerLinkTemplate()
- 11.x core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php \Drupal\Tests\Core\Entity\EntityUrlTest::registerLinkTemplate()
Registers a link template for the mock entity.
Parameters
string $link_template: The link template to register.
6 calls to EntityUrlTest::registerLinkTemplate()
- EntityUrlTest::testToUrlDefaultFallback in core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityUrlTest.php - Tests the toUrl() method without specifying the $rel parameter.
- EntityUrlTest::testToUrlLinkTemplateAddForm in core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityUrlTest.php - Tests the toUrl() method with the 'revision' link template.
- EntityUrlTest::testToUrlLinkTemplateNoId in core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityUrlTest.php - Tests the toUrl() method with link templates without an entity ID.
- EntityUrlTest::testToUrlLinkTemplateRevision in core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityUrlTest.php - Tests the toUrl() method with the 'revision' link template.
- EntityUrlTest::testToUrlLinkTemplates in core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityUrlTest.php - Tests the toUrl() method with simple link templates.
File
-
core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityUrlTest.php, line 533
Class
- EntityUrlTest
- Tests URL handling of the \Drupal\Core\Entity\EntityBase class.
Namespace
Drupal\Tests\Core\EntityCode
protected function registerLinkTemplate($link_template) {
$link_templates = [
// The path is actually never used because we never invoke the URL
// generator but perform assertions on the URL object directly.
$link_template => "/test-entity/{test_entity}/{$link_template}",
];
$this->entityType
->getLinkTemplates()
->willReturn($link_templates);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.