Mercurial > hg > isophonics-drupal-site
comparison core/modules/node/tests/src/Functional/NodeContextualLinksTest.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\Tests\node\Functional; | |
4 | |
5 use Drupal\node\Entity\Node; | |
6 | |
7 /** | |
8 * Tests views contextual links on nodes. | |
9 * | |
10 * @group node | |
11 */ | |
12 class NodeContextualLinksTest extends NodeTestBase { | |
13 | |
14 /** | |
15 * {@inheritdoc} | |
16 */ | |
17 public static $modules = [ | |
18 'contextual', | |
19 ]; | |
20 | |
21 /** | |
22 * Tests contextual links. | |
23 */ | |
24 public function testNodeContextualLinks() { | |
25 // Create a node item. | |
26 $node = Node::create([ | |
27 'type' => 'article', | |
28 'title' => 'Unnamed', | |
29 ]); | |
30 $node->save(); | |
31 | |
32 $user = $this->drupalCreateUser([ | |
33 'administer nodes', | |
34 'access contextual links', | |
35 ]); | |
36 $this->drupalLogin($user); | |
37 | |
38 $this->drupalGet('node/' . $node->id()); | |
39 $this->assertSession()->elementAttributeContains('css', 'div[data-contextual-id]', 'data-contextual-id', 'node:node=' . $node->id() . ':'); | |
40 } | |
41 | |
42 } |