You are here

public function ToolkitTest::testGetAvailableToolkits in Drupal 8

Check that ImageToolkitManager::getAvailableToolkits() only returns available toolkits.

File

core/tests/Drupal/FunctionalTests/Image/ToolkitTest.php, line 21

Class

ToolkitTest
Tests image toolkit functions.

Namespace

Drupal\FunctionalTests\Image

Code

public function testGetAvailableToolkits() {
  $manager = $this->container
    ->get('image.toolkit.manager');
  $toolkits = $manager
    ->getAvailableToolkits();
  $this
    ->assertTrue(isset($toolkits['test']), 'The working toolkit was returned.');
  $this
    ->assertTrue(isset($toolkits['test:derived_toolkit']), 'The derived toolkit was returned.');
  $this
    ->assertFalse(isset($toolkits['broken']), 'The toolkit marked unavailable was not returned');
  $this
    ->assertToolkitOperationsCalled([]);
}