public function BambooTwigSecurityTest::setUp in Bamboo Twig 8.5
Same name in this branch
- 8.5 tests/src/Functional/BambooTwigSecurityTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigSecurityTest::setUp()
- 8.5 tests/src/Kernel/BambooTwigSecurityTest.php \Drupal\Tests\bamboo_twig\Kernel\BambooTwigSecurityTest::setUp()
Same name and namespace in other branches
- 8 tests/src/Functional/BambooTwigSecurityTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigSecurityTest::setUp()
- 8.2 tests/src/Functional/BambooTwigSecurityTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigSecurityTest::setUp()
- 8.3 tests/src/Functional/BambooTwigSecurityTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigSecurityTest::setUp()
- 8.4 tests/src/Functional/BambooTwigSecurityTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigSecurityTest::setUp()
Overrides BambooTwigTestBase::setUp
File
- tests/
src/ Functional/ BambooTwigSecurityTest.php, line 27
Class
- BambooTwigSecurityTest
- Tests Security twig filters and functions.
Namespace
Drupal\Tests\bamboo_twig\FunctionalCode
public function setUp() : void {
parent::setUp();
/** @var \Drupal\Core\Entity\EntityTypeManager $entityTypeManager */
$this->entityTypeManager = $this->container
->get('entity_type.manager');
$this->admin_user = $this
->drupalCreateUser([
'access content',
'administer content types',
'bypass node access',
'administer site configuration',
'view the administration theme',
'administer menu',
'access administration pages',
]);
$this->admin_user
->addRole('administrator');
$this->admin_user
->save();
// Add the administrator roles to the default user 1.
$admin = $this->entityTypeManager
->getStorage('user')
->load(1);
$admin
->addRole('administrator');
$admin
->save();
}