function ToolkitTest::testGetAvailableToolkits

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

File

drupal/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTest.php, line 28
Definition of Drupal\system\Tests\Image\ToolkitTest.

Class

ToolkitTest
Test that the functions in image.inc correctly pass data to the toolkit.

Namespace

Drupal\system\Tests\Image

Code

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