protected function FieldFormatterWithInlineSettingsTest::setUp in (Entity Reference) Field Formatters 8.2
Same name and namespace in other branches
- 8 tests/src/Kernel/Plugin/Field/FieldFormatter/FieldFormatterWithInlineSettingsTest.php \Drupal\Tests\field_formatter\Kernel\Plugin\Field\FieldFormatter\FieldFormatterWithInlineSettingsTest::setUp()
- 3.x tests/src/Kernel/Plugin/Field/FieldFormatter/FieldFormatterWithInlineSettingsTest.php \Drupal\Tests\field_formatter\Kernel\Plugin\Field\FieldFormatter\FieldFormatterWithInlineSettingsTest::setUp()
Overrides KernelTestBase::setUp
File
- tests/
src/ Kernel/ Plugin/ Field/ FieldFormatter/ FieldFormatterWithInlineSettingsTest.php, line 40
Class
- FieldFormatterWithInlineSettingsTest
- @coversDefaultClass \Drupal\field_formatter\Plugin\Field\FieldFormatter\FieldFormatterWithInlineSettings @group field_formatter
Namespace
Drupal\Tests\field_formatter\Kernel\Plugin\Field\FieldFormatterCode
protected function setUp() {
parent::setUp();
$this
->installSchema('system', [
'sequences',
]);
$this
->installEntitySchema('entity_test');
$this
->installEntitySchema('user');
$admin_role = Role::create([
'id' => 'admin',
'permissions' => [
'view test entity',
],
]);
$admin_role
->save();
$this->adminUser = User::create([
'name' => $this
->randomMachineName(),
'roles' => [
$admin_role
->id(),
],
]);
$this->adminUser
->save();
\Drupal::currentUser()
->setAccount($this->adminUser);
}