You are here

protected function ResponsiveImageFieldUiTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/responsive_image/src/FunctionalJavascript/ResponsiveImageFieldUiTest.php \Drupal\responsive_image\Tests\ResponsiveImageFieldUiTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/responsive_image/src/FunctionalJavascript/ResponsiveImageFieldUiTest.php, line 32

Class

ResponsiveImageFieldUiTest
Tests the responsive image field UI.

Namespace

Drupal\responsive_image\Tests

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->drupalPlaceBlock('system_breadcrumb_block');

  // Create a test user.
  $admin_user = $this
    ->drupalCreateUser([
    'access content',
    'administer content types',
    'administer node fields',
    'administer node form display',
    'administer node display',
    'bypass node access',
  ]);
  $this
    ->drupalLogin($admin_user);

  // Create content type, with underscores.
  $type_name = strtolower($this
    ->randomMachineName(8)) . '_test';
  $type = $this
    ->drupalCreateContentType([
    'name' => $type_name,
    'type' => $type_name,
  ]);
  $this->type = $type
    ->id();
}