class ActionListTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/action/tests/src/Functional/ActionListTest.php \Drupal\Tests\action\Functional\ActionListTest
- 9 core/modules/action/tests/src/Functional/ActionListTest.php \Drupal\Tests\action\Functional\ActionListTest
Test behaviors when visiting the action listing page.
@group action
Hierarchy
- class \Drupal\Tests\BrowserTestBase extends \PHPUnit\Framework\TestCase uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, FunctionalTestSetupTrait, TestSetupTrait, BlockCreationTrait, ConfigTestTrait, ExtensionListTestTrait, ContentTypeCreationTrait, NodeCreationTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings, UiHelperTrait, UserCreationTrait, XdebugRequestTrait
- class \Drupal\Tests\action\Functional\ActionListTest
Expanded class hierarchy of ActionListTest
File
- core/
modules/ action/ tests/ src/ Functional/ ActionListTest.php, line 12
Namespace
Drupal\Tests\action\FunctionalView source
class ActionListTest extends BrowserTestBase {
/**
* Modules to install.
*
* @var array
*/
protected static $modules = [
'action',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* 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 \Drupal\Core\Entity\EntityStorageInterface $storage */
$storage = $this->container
->get('entity_type.manager')
->getStorage('action');
$actions = $storage
->loadMultiple();
$storage
->delete($actions);
$this
->drupalGet('/admin/config/system/actions');
$this
->assertSession()
->pageTextContains('There are no actions yet.');
}
}