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. 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()

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

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