function ResponsiveImageFieldDisplayTest::setUp

Same name in other branches
  1. 9 core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php \Drupal\Tests\responsive_image\Functional\ResponsiveImageFieldDisplayTest::setUp()
  2. 8.9.x core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php \Drupal\Tests\responsive_image\Functional\ResponsiveImageFieldDisplayTest::setUp()
  3. 11.x core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php \Drupal\Tests\responsive_image\Functional\ResponsiveImageFieldDisplayTest::setUp()

Overrides ImageFieldTestBase::setUp

File

core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php, line 59

Class

ResponsiveImageFieldDisplayTest
Tests responsive image display formatter.

Namespace

Drupal\Tests\responsive_image\Functional

Code

protected function setUp() : void {
    parent::setUp();
    $this->fileUrlGenerator = $this->container
        ->get('file_url_generator');
    // Create user.
    $this->adminUser = $this->drupalCreateUser([
        'administer responsive images',
        'access content',
        'access administration pages',
        'administer site configuration',
        'administer content types',
        'administer node display',
        'administer nodes',
        'create article content',
        'edit any article content',
        'delete any article content',
        'administer image styles',
    ]);
    $this->drupalLogin($this->adminUser);
    // Add responsive image style.
    $this->responsiveImgStyle = ResponsiveImageStyle::create([
        'id' => 'style_one',
        'label' => 'Style One',
        'breakpoint_group' => 'responsive_image_test_module',
        'fallback_image_style' => 'large',
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.