3 namespace Drupal\Tests\node\Functional;
5 use Drupal\node\NodeInterface;
8 * Tests the output of node links (read more, add new comment, etc).
12 class NodeLinksTest extends NodeTestBase {
19 public static $modules = ['views'];
22 * Tests that the links can be hidden in the view display settings.
24 public function testHideLinks() {
25 $node = $this->drupalCreateNode([
27 'promote' => NodeInterface::PROMOTED,
30 // Links are displayed by default.
31 $this->drupalGet('node');
32 $this->assertText($node->getTitle());
33 $this->assertLink('Read more');
36 entity_get_display('node', 'article', 'teaser')
37 ->removeComponent('links')
40 $this->drupalGet('node');
41 $this->assertText($node->getTitle());
42 $this->assertNoLink('Read more');