public function ContentRoleTest::test in Lightning Core 8.3
Same name and namespace in other branches
- 8 modules/lightning_roles/tests/src/Kernel/ContentRoleTest.php \Drupal\Tests\lightning_roles\Kernel\ContentRoleTest::test()
- 8.2 modules/lightning_roles/tests/src/Kernel/ContentRoleTest.php \Drupal\Tests\lightning_roles\Kernel\ContentRoleTest::test()
File
- modules/
lightning_roles/ tests/ src/ Kernel/ ContentRoleTest.php, line 35
Class
- ContentRoleTest
- @group lightning @group lightning_roles @group orca_public
Namespace
Drupal\Tests\lightning_roles\KernelCode
public function test() {
$node_type = NodeType::create([
'type' => $this
->randomMachineName(),
]);
$node_type
->save();
$role_ids = [
$node_type
->id() . '_creator',
$node_type
->id() . '_reviewer',
];
$roles = Role::loadMultiple($role_ids);
$this
->assertCount(2, $roles);
foreach ($roles as $role) {
$this
->assertSame(FALSE, $role
->get('is_admin'));
}
$node_type
->delete();
$this
->assertEmpty(Role::loadMultiple($role_ids));
}