PermissionsTest.php in Drupal 10
File
core/modules/system/tests/src/Kernel/PermissionsTest.php
View source
<?php
namespace Drupal\Tests\system\Kernel;
use Drupal\KernelTests\KernelTestBase;
class PermissionsTest extends KernelTestBase {
protected static $modules = [
'system',
'user',
];
public function testAccessContentPermission() {
$this
->installSchema('user', [
'users_data',
]);
$permissions = $this->container
->get('user.permissions')
->getPermissions();
$this
->assertSame('system', $permissions['access content']['provider']);
$this->container
->get('module_installer')
->install([
'node',
]);
$permissions = $this->container
->get('user.permissions')
->getPermissions();
$this
->assertSame('system', $permissions['access content']['provider']);
$this->container
->get('module_installer')
->uninstall([
'node',
]);
$permissions = $this->container
->get('user.permissions')
->getPermissions();
$this
->assertSame('system', $permissions['access content']['provider']);
}
}