diff --git a/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitGdTest.php b/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitGdTest.php index ac84f71..654f1b5 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitGdTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitGdTest.php @@ -8,7 +8,6 @@ namespace Drupal\system\Tests\Image; use Drupal\simpletest\DrupalUnitTestBase; -use Drupal\Core\ImageToolkit\ImageToolkitManager; /** * Test the core GD image manipulation functions. @@ -215,7 +214,7 @@ function testManipulations() { ); } - $manager = new ImageToolkitManager($this->container->get('container.namespaces'), $this->container->get('cache.cache'), $this->container->get('language_manager')); + $manager = $this->container->get('plugin.manager.image_toolkit'); foreach ($files as $file) { foreach ($operations as $op => $values) { // Load up a fresh image. diff --git a/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTest.php b/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTest.php index c765d2f..37e1c7f 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTest.php @@ -7,8 +7,6 @@ namespace Drupal\system\Tests\Image; -use Drupal\Core\ImageToolkit\ImageToolkitManager; - /** * Test that the functions in image.inc correctly pass data to the toolkit. */ @@ -26,7 +24,7 @@ public static function getInfo() { * available toolkits. */ function testGetAvailableToolkits() { - $manager = new ImageToolkitManager($this->container->get('container.namespaces'), $this->container->get('cache.cache'), $this->container->get('language_manager')); + $manager = $this->container->get('plugin.manager.image_toolkit'); $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'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTestBase.php index 503bf0e..ae59ed4 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitTestBase.php @@ -8,8 +8,6 @@ namespace Drupal\system\Tests\Image; use Drupal\simpletest\WebTestBase; -use Drupal\Core\ImageToolkit\ImageToolkitManager; -use stdClass; /** * Base class for image manipulation testing. @@ -31,7 +29,7 @@ function setUp() { parent::setUp(); // Use the image_test.module's test toolkit. - $manager = new ImageToolkitManager($this->container->get('container.namespaces'), $this->container->get('cache.cache'), $this->container->get('language_manager')); + $manager = $this->container->get('plugin.manager.image_toolkit'); $this->toolkit = $manager->createInstance('test'); // Pick a file for testing. @@ -40,7 +38,7 @@ function setUp() { // Setup a dummy image to work with, this replicate image_load() so we // can avoid calling it. - $this->image = new stdClass(); + $this->image = new \stdClass(); $this->image->source = $this->file; $this->image->info = image_get_info($this->file); $this->image->toolkit = $this->toolkit;