ActionListTest.php 993 Bytes
Newer Older
1 2
<?php

3
namespace Drupal\Tests\action\Functional;
4

5
use Drupal\Tests\BrowserTestBase;
6 7 8 9 10 11

/**
 * Test behaviors when visiting the action listing page.
 *
 * @group action
 */
12
class ActionListTest extends BrowserTestBase {
13 14 15 16 17 18

  /**
   * Modules to install.
   *
   * @var array
   */
19
  public static $modules = ['action'];
20 21 22 23 24 25 26 27 28 29 30

  /**
   * Tests the behavior when there are no actions to list in the admin page.
   */
  public function testEmptyActionList() {
    // Create a user with permission to view the actions administration pages.
    $this->drupalLogin($this->drupalCreateUser(['administer actions']));

    // Ensure the empty text appears on the action list page.
    /** @var $storage \Drupal\Core\Entity\EntityStorageInterface */
    $storage = $this->container->get('entity.manager')->getStorage('action');
31
    $actions = $storage->loadMultiple();
32 33
    $storage->delete($actions);
    $this->drupalGet('/admin/config/system/actions');
34
    $this->assertRaw('There are no actions yet.');
35 36 37
  }

}