protected function DateRecurFieldItemDefaultValuesTest::setUp in Recurring Dates Field 3.0.x
Same name and namespace in other branches
- 8.2 tests/src/Kernel/DateRecurFieldItemDefaultValuesTest.php \Drupal\Tests\date_recur\Kernel\DateRecurFieldItemDefaultValuesTest::setUp()
- 3.x tests/src/Kernel/DateRecurFieldItemDefaultValuesTest.php \Drupal\Tests\date_recur\Kernel\DateRecurFieldItemDefaultValuesTest::setUp()
- 3.1.x tests/src/Kernel/DateRecurFieldItemDefaultValuesTest.php \Drupal\Tests\date_recur\Kernel\DateRecurFieldItemDefaultValuesTest::setUp()
Overrides KernelTestBase::setUp
File
- tests/
src/ Kernel/ DateRecurFieldItemDefaultValuesTest.php, line 50
Class
- DateRecurFieldItemDefaultValuesTest
- Tests date_recur field with default values configured at the instance level.
Namespace
Drupal\Tests\date_recur\KernelCode
protected function setUp() : void {
parent::setUp();
$this
->installEntitySchema('dr_entity_test');
$this
->installConfig([
'system',
]);
/** @var \Drupal\Core\Entity\EntityFieldManagerInterface $entityFieldManager */
$entityFieldManager = \Drupal::service('entity_field.manager');
$baseFields = $entityFieldManager
->getBaseFieldDefinitions('dr_entity_test');
$this->baseFieldOverride = BaseFieldOverride::createFromBaseFieldDefinition($baseFields['dr'], 'dr_entity_test');
$user = User::create([
'uid' => 2,
'timezone' => 'Asia/Singapore',
]);
$this->container
->get('current_user')
->setAccount($user);
}