RoleValidationTest.php

Namespace

Drupal\Tests\user\Kernel

File

core/modules/user/tests/src/Kernel/RoleValidationTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\user\Kernel;

use Drupal\KernelTests\Core\Config\ConfigEntityValidationTestBase;
use Drupal\user\Entity\Role;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;

/**
 * Tests validation of user_role entities.
 */
class RoleValidationTest extends ConfigEntityValidationTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected static $modules = [
    'user',
  ];
  
  /**
   * {@inheritdoc}
   */
  protected function setUp() : void {
    parent::setUp();
    $this->installConfig('user');
    $this->entity = Role::create([
      'id' => 'test',
      'label' => 'Test',
    ]);
    $this->entity
      ->save();
  }

}

Classes

Title Deprecated Summary
RoleValidationTest Tests validation of user_role entities.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.