function ToolkitTest::testGetAvailableToolkits

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Image/ToolkitTest.php \Drupal\KernelTests\Core\Image\ToolkitTest::testGetAvailableToolkits()
  2. 8.9.x core/tests/Drupal/FunctionalTests/Image/ToolkitTest.php \Drupal\FunctionalTests\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 56

Class

ToolkitTest
Tests the image toolkit.

Namespace

Drupal\KernelTests\Core\Image

Code

public function testGetAvailableToolkits() : void {
    $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.