function ToolkitTest::testGetAvailableToolkits

Same name in other branches
  1. 8.9.x core/tests/Drupal/FunctionalTests/Image/ToolkitTest.php \Drupal\FunctionalTests\Image\ToolkitTest::testGetAvailableToolkits()
  2. 10 core/tests/Drupal/KernelTests/Core/Image/ToolkitTest.php \Drupal\KernelTests\Core\Image\ToolkitTest::testGetAvailableToolkits()
  3. 11.x core/tests/Drupal/KernelTests/Core/Image/ToolkitTest.php \Drupal\KernelTests\Core\Image\ToolkitTest::testGetAvailableToolkits()

Tests that the toolkit manager only returns available toolkits.

File

core/tests/Drupal/KernelTests/Core/Image/ToolkitTest.php, line 53

Class

ToolkitTest
Tests the image toolkit.

Namespace

Drupal\KernelTests\Core\Image

Code

public function testGetAvailableToolkits() {
    $manager = $this->container
        ->get('image.toolkit.manager');
    $toolkits = $manager->getAvailableToolkits();
    $this->assertArrayHasKey('test', $toolkits);
    $this->assertArrayHasKey('test:derived_toolkit', $toolkits);
    $this->assertArrayNotHasKey('broken', $toolkits);
    $this->assertToolkitOperationsCalled([]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.