class GdToolkitNoTransparencyGifImageManipulationTest
GD image toolkit image manipulation of no-transparency GIF images.
Attributes
#[CoversClass(GDToolkit::class)]
#[Group('Image')]
#[RequiresPhpExtension('gd')]
#[RunTestsInSeparateProcesses]
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\PhpUnitCompatibilityTrait, \Prophecy\PhpUnit\ProphecyTrait, \Drupal\TestTools\Extension\DeprecationBridge\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\KernelTests\Core\Image\GdToolkitImageManipulationTestBase extends \Drupal\KernelTests\KernelTestBase
- class \Drupal\KernelTests\Core\Image\GdToolkitNoTransparencyGifImageManipulationTest extends \Drupal\KernelTests\Core\Image\GdToolkitImageManipulationTestBase
- class \Drupal\KernelTests\Core\Image\GdToolkitImageManipulationTestBase extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of GdToolkitNoTransparencyGifImageManipulationTest
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Image/ GdToolkitNoTransparencyGifImageManipulationTest.php, line 16
Namespace
Drupal\KernelTests\Core\ImageView source
class GdToolkitNoTransparencyGifImageManipulationTest extends GdToolkitImageManipulationTestBase {
/**
* {@inheritdoc}
*/
protected string $sourceTestImage = 'image-test-no-transparency.gif';
/**
* {@inheritdoc}
*/
public static function providerOperationTestCases() : array {
$ret = parent::providerOperationTestCases();
// The test gif that does not have transparency color set is a special
// case.
foreach ($ret as $test_case => &$data) {
foreach ($data[3]['corners'] as &$expected_color) {
if ($test_case == 'desaturate') {
// For desaturating, keep the expected color from the test data, but
// set alpha channel to fully opaque.
$expected_color[3] = 0;
}
elseif ($expected_color === static::TRANSPARENT) {
// Set expected pixel to yellow where the others have
// transparent.
$expected_color = static::YELLOW;
}
}
}
return $ret;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.