ImageFieldTestBase.php

Same filename in this branch
  1. 9 core/modules/image/tests/src/Functional/ImageFieldTestBase.php
Same filename in other branches
  1. 8.9.x core/modules/image/src/Tests/ImageFieldTestBase.php
  2. 8.9.x core/modules/image/tests/src/FunctionalJavascript/ImageFieldTestBase.php
  3. 8.9.x core/modules/image/tests/src/Functional/ImageFieldTestBase.php
  4. 10 core/modules/image/tests/src/FunctionalJavascript/ImageFieldTestBase.php
  5. 10 core/modules/image/tests/src/Functional/ImageFieldTestBase.php
  6. 11.x core/modules/image/tests/src/FunctionalJavascript/ImageFieldTestBase.php
  7. 11.x core/modules/image/tests/src/Functional/ImageFieldTestBase.php

Namespace

Drupal\Tests\image\FunctionalJavascript

File

core/modules/image/tests/src/FunctionalJavascript/ImageFieldTestBase.php

View source
<?php

namespace Drupal\Tests\image\FunctionalJavascript;

use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
use Drupal\Tests\image\Kernel\ImageFieldCreationTrait;
use Drupal\Tests\TestFileCreationTrait;

/**
 * This class provides methods specifically for testing Image's field handling.
 */
abstract class ImageFieldTestBase extends WebDriverTestBase {
    use ImageFieldCreationTrait;
    use TestFileCreationTrait {
        getTestFiles as drupalGetTestFiles;
    }
    
    /**
     * Modules to enable.
     *
     * @var array
     */
    protected static $modules = [
        'node',
        'image',
        'field_ui',
        'image_module_test',
    ];
    
    /**
     * A user with permissions to administer content types and image styles.
     *
     * @var \Drupal\user\UserInterface
     */
    protected $adminUser;
    
    /**
     * {@inheritdoc}
     */
    protected function setUp() {
        parent::setUp();
        // Create Basic page and Article node types.
        if ($this->profile !== 'standard') {
            $this->drupalCreateContentType([
                'type' => 'page',
                'name' => 'Basic page',
            ]);
            $this->drupalCreateContentType([
                'type' => 'article',
                'name' => 'Article',
            ]);
        }
        $this->adminUser = $this->drupalCreateUser([
            'access content',
            'access administration pages',
            'administer site configuration',
            'administer content types',
            'administer node fields',
            'administer nodes',
            'create article content',
            'edit any article content',
            'delete any article content',
            'administer image styles',
            'administer node display',
        ]);
        $this->drupalLogin($this->adminUser);
    }

}

Classes

Title Deprecated Summary
ImageFieldTestBase This class provides methods specifically for testing Image's field handling.

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