Added Entity and Entity Reference Revisions which got dropped somewhere along the...
[yaffs-website] / web / modules / contrib / entity / tests / src / Functional / Menu / EntityLocalActionTest.php
1 <?php
2
3 namespace Drupal\Tests\entity\Functional\Menu;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8  * Tests that entity local actions are generated correctly.
9  *
10  * @group entity
11  *
12  * @runTestsInSeparateProcesses
13  *
14  * @preserveGlobalState disabled
15  */
16 class EntityLocalActionTest extends BrowserTestBase {
17
18   /**
19    * {@inheritdoc}
20    */
21   protected static $modules = ['block', 'entity', 'entity_module_test'];
22
23   /**
24    * {@inheritdoc}
25    */
26   protected function setUp() {
27     parent::setUp();
28
29     $this->drupalPlaceBlock('local_actions_block');
30
31     $account = $this->drupalCreateUser(['administer entity_test_enhanced']);
32     $this->drupalLogin($account);
33   }
34
35   /**
36    * Tests the local action on the collection is provided correctly.
37    */
38   public function testCollectionLocalAction() {
39     $this->drupalGet('/entity_test_enhanced');
40     $this->assertSession()->linkByHrefExists('/entity_test_enhanced/add?destination=/entity_test_enhanced');
41     $this->assertSession()->linkExists('Add enhanced entity');
42   }
43
44 }