You are here

public function ImageEffectsTestBase::assertColorsAreNotEqual 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::assertColorsAreNotEqual()
  2. 8.2 tests/src/Functional/ImageEffectsTestBase.php \Drupal\Tests\image_effects\Functional\ImageEffectsTestBase::assertColorsAreNotEqual()

Assert two colors are not equal by RGBA.

1 call to ImageEffectsTestBase::assertColorsAreNotEqual()
WatermarkTest::testWatermarkEffect in tests/src/Functional/Effect/WatermarkTest.php
Watermark effect test.

File

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

Class

ImageEffectsTestBase
Base test class for image_effects tests.

Namespace

Drupal\Tests\image_effects\Functional

Code

public function assertColorsAreNotEqual(array $actual, array $expected) : void {

  // Fully transparent colors are equal, regardless of RGB.
  if ($expected[3] == 127) {
    $this
      ->assertNotEquals(127, $actual[3]);
    return;
  }
  $this
    ->assertColorsAreNotClose($actual, $expected, 0);
}