function FieldBlockTest::setUp
Same name in this branch
- 10 core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php \Drupal\Tests\layout_builder\Kernel\FieldBlockTest::setUp()
Same name in other branches
- 9 core/modules/layout_builder/tests/src/FunctionalJavascript/FieldBlockTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\FieldBlockTest::setUp()
- 9 core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php \Drupal\Tests\layout_builder\Kernel\FieldBlockTest::setUp()
- 8.9.x core/modules/layout_builder/tests/src/FunctionalJavascript/FieldBlockTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\FieldBlockTest::setUp()
- 8.9.x core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php \Drupal\Tests\layout_builder\Kernel\FieldBlockTest::setUp()
- 11.x core/modules/layout_builder/tests/src/FunctionalJavascript/FieldBlockTest.php \Drupal\Tests\layout_builder\FunctionalJavascript\FieldBlockTest::setUp()
- 11.x core/modules/layout_builder/tests/src/Kernel/FieldBlockTest.php \Drupal\Tests\layout_builder\Kernel\FieldBlockTest::setUp()
Overrides BrowserTestBase::setUp
File
-
core/
modules/ layout_builder/ tests/ src/ FunctionalJavascript/ FieldBlockTest.php, line 42
Class
- FieldBlockTest
- @coversDefaultClass \Drupal\layout_builder\Plugin\Block\FieldBlock
Namespace
Drupal\Tests\layout_builder\FunctionalJavascriptCode
protected function setUp() : void {
parent::setUp();
$field_storage = FieldStorageConfig::create([
'field_name' => 'field_date',
'entity_type' => 'user',
'type' => 'datetime',
]);
$field_storage->save();
$field = FieldConfig::create([
'field_storage' => $field_storage,
'bundle' => 'user',
'label' => 'Date field',
]);
$field->save();
$user = $this->drupalCreateUser([
'administer blocks',
'access administration pages',
]);
$user->field_date = '1978-11-19T05:00:00';
$user->save();
$this->drupalLogin($user);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.