28eda681876c2af7cda6432e789f17b384dc033a
[yaffs-website] / web / core / modules / action / tests / src / Functional / ActionListTest.php
1 <?php
2
3 namespace Drupal\Tests\action\Functional;
4
5 use Drupal\Tests\BrowserTestBase;
6
7 /**
8  * Test behaviors when visiting the action listing page.
9  *
10  * @group action
11  */
12 class ActionListTest extends BrowserTestBase {
13
14   /**
15    * Modules to install.
16    *
17    * @var array
18    */
19   public static $modules = ['action'];
20
21   /**
22    * Tests the behavior when there are no actions to list in the admin page.
23    */
24   public function testEmptyActionList() {
25     // Create a user with permission to view the actions administration pages.
26     $this->drupalLogin($this->drupalCreateUser(['administer actions']));
27
28     // Ensure the empty text appears on the action list page.
29     /** @var $storage \Drupal\Core\Entity\EntityStorageInterface */
30     $storage = $this->container->get('entity.manager')->getStorage('action');
31     $actions = $storage->loadMultiple();
32     $storage->delete($actions);
33     $this->drupalGet('/admin/config/system/actions');
34     $this->assertRaw('There are no actions yet.');
35   }
36
37 }