You are here

protected function AnimatedGifFieldTest::setUp in Animated GIF 8

Overrides AnimatedGifFunctionalTestBase::setUp

File

tests/src/Functional/AnimatedGifFieldTest.php, line 53

Class

AnimatedGifFieldTest
Tests fields styles.

Namespace

Drupal\Tests\animated_gif\Functional

Code

protected function setUp() : void {
  parent::setUp();
  $entityType = 'node';
  $bundle = 'article';

  // Attach file to the node.
  $this
    ->createFileField($entityType, $bundle, $this->fieldName);

  // Create the node.
  $this->node = $this
    ->drupalCreateNode([
    'type' => $bundle,
  ]);
  $this->node
    ->save();
  $this->displayRepository
    ->getFormDisplay($entityType, $bundle)
    ->setComponent($this->fieldName, [
    'type' => 'image_image',
  ])
    ->save();
}