You are here

public function ToolkitTest::testGetAvailableToolkits in Drupal 9

Tests that the toolkit manager only returns available toolkits.

File

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

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([]);
}