protected function QuickEditFileTest::setUp in Drupal 10
Same name and namespace in other branches
- 8 core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditFileTest.php \Drupal\Tests\quickedit\FunctionalJavascript\QuickEditFileTest::setUp()
- 9 core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditFileTest.php \Drupal\Tests\quickedit\FunctionalJavascript\QuickEditFileTest::setUp()
File
- core/
modules/ quickedit/ tests/ src/ FunctionalJavascript/ QuickEditFileTest.php, line 35
Class
- QuickEditFileTest
- @group quickedit
Namespace
Drupal\Tests\quickedit\FunctionalJavascriptCode
protected function setUp() : void {
parent::setUp();
// Create the Article node type.
$this
->drupalCreateContentType([
'type' => 'article',
'name' => 'Article',
]);
// Add file field to Article node type.
$this
->createFileField('field_file', 'node', 'article', [
'file_extensions' => 'txt',
]);
// Move file field to the top of all fields, so its QuickEdit Toolbar won't
// overlap any QuickEdit-able fields, which causes (semi-)random test
// failures.
$entity_display = EntityViewDisplay::load('node.article.default');
$entity_display
->setComponent('field_file', [
'weight' => 0,
]);
$entity_display
->save();
// Log in as a content author who can use Quick Edit and edit Articles.
$user = $this
->drupalCreateUser([
'access contextual links',
'access toolbar',
'access in-place editing',
'access content',
'create article content',
'edit any article content',
]);
$this
->drupalLogin($user);
}