function FieldEntityLinkTest::testEntityLink
Same name in other branches
- 8.9.x core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php \Drupal\Tests\views\Kernel\Handler\FieldEntityLinkTest::testEntityLink()
- 10 core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php \Drupal\Tests\views\Kernel\Handler\FieldEntityLinkTest::testEntityLink()
- 11.x core/modules/views/tests/src/Kernel/Handler/FieldEntityLinkTest.php \Drupal\Tests\views\Kernel\Handler\FieldEntityLinkTest::testEntityLink()
Tests entity link fields.
File
-
core/
modules/ views/ tests/ src/ Kernel/ Handler/ FieldEntityLinkTest.php, line 70
Class
- FieldEntityLinkTest
- Tests the core Drupal\views\Plugin\views\field\EntityOperations handler.
Namespace
Drupal\Tests\views\Kernel\HandlerCode
public function testEntityLink() {
// Anonymous users cannot see edit/delete links.
$expected_results = [
'canonical' => TRUE,
'edit-form' => FALSE,
'delete-form' => FALSE,
'canonical_raw' => TRUE,
'canonical_raw_absolute' => TRUE,
];
$this->doTestEntityLink(\Drupal::currentUser(), $expected_results);
// Admin users cannot see all links.
$expected_results = [
'canonical' => TRUE,
'edit-form' => TRUE,
'delete-form' => TRUE,
'canonical_raw' => TRUE,
'canonical_raw_absolute' => TRUE,
];
$this->doTestEntityLink($this->adminUser, $expected_results);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.