You are here

public function ImageEffectsTestBase::setUp in Image Effects 8.3

Same name and namespace in other branches
  1. 8 tests/src/Functional/ImageEffectsTestBase.php \Drupal\Tests\image_effects\Functional\ImageEffectsTestBase::setUp()
  2. 8.2 tests/src/Functional/ImageEffectsTestBase.php \Drupal\Tests\image_effects\Functional\ImageEffectsTestBase::setUp()

Overrides BrowserTestBase::setUp

3 calls to ImageEffectsTestBase::setUp()
AspectSwitcherTest::setUp in tests/src/Functional/Effect/AspectSwitcherTest.php
AutoOrientTest::setUp in tests/src/Functional/Effect/AutoOrientTest.php
TextOverlayTest::setUp in tests/src/Functional/Effect/TextOverlayTest.php
3 methods override ImageEffectsTestBase::setUp()
AspectSwitcherTest::setUp in tests/src/Functional/Effect/AspectSwitcherTest.php
AutoOrientTest::setUp in tests/src/Functional/Effect/AutoOrientTest.php
TextOverlayTest::setUp in tests/src/Functional/Effect/TextOverlayTest.php

File

tests/src/Functional/ImageEffectsTestBase.php, line 85

Class

ImageEffectsTestBase
Base test class for image_effects tests.

Namespace

Drupal\Tests\image_effects\Functional

Code

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

  // Set the image factory.
  $this->imageFactory = $this->container
    ->get('image.factory');

  // Set the file system.
  $this->fileSystem = $this->container
    ->get('file_system');

  // Create a user and log it in.
  $this->adminUser = $this
    ->drupalCreateUser([
    'administer site configuration',
    'administer image styles',
  ]);
  $this
    ->drupalLogin($this->adminUser);

  // Create the test image style.
  $this->testImageStyle = ImageStyle::create([
    'name' => $this->testImageStyleName,
    'label' => $this->testImageStyleLabel,
  ]);
  $this
    ->assertEquals(SAVED_NEW, $this->testImageStyle
    ->save());
}