You are here

public function FileImageTest::setUp in Acquia Content Hub 8

Overrides ContentHubTestBase::setUp

File

tests/src/Functional/FileImageTest.php, line 69

Class

FileImageTest
Test that Acquia Content Hub produces a correct CDF of node with image file.

Namespace

Drupal\Tests\acquia_contenthub\Functional

Code

public function setUp() : void {
  parent::setUp();

  // Create the users used for the tests.
  $this->adminRole = $this
    ->createAdminRole('administrator', 'Administrator');
  $this->adminUser = $this
    ->drupalCreateUser($this->adminUserPermissions);

  // Create a field image for test purposes.
  $field_name = 'field_image_test';
  $min_resolution = 50;
  $max_resolution = 100;
  $field_settings = [
    'max_resolution' => $max_resolution . 'x' . $max_resolution,
    'min_resolution' => $min_resolution . 'x' . $min_resolution,
    'alt_field' => 0,
  ];
  $this
    ->createImageField($field_name, 'article', [], $field_settings, [], [], 'Image test on [site:name]');
}