You are here

public function GdImageAnalysisTest::setUp in Image Effects 8.3

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

File

tests/src/Unit/GdImageAnalysisTest.php, line 25

Class

GdImageAnalysisTest
Tests the image analysis helper methods.

Namespace

Drupal\Tests\image_effects\Unit

Code

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

  // Create a test image with 3 red, 3 green, and 3 blue pixels.
  $this->testImage = imagecreatetruecolor(3, 3);
  imagefilledrectangle($this->testImage, 0, 0, 2, 0, imagecolorallocate($this->testImage, 255, 0, 0));
  imagefilledrectangle($this->testImage, 0, 1, 2, 1, imagecolorallocate($this->testImage, 0, 255, 0));
  imagefilledrectangle($this->testImage, 0, 2, 2, 2, imagecolorallocate($this->testImage, 0, 0, 255));
}