diff --git a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitBase.php b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitBase.php index ef18aa8..717536f 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitBase.php +++ b/core/modules/system/lib/Drupal/system/Plugin/ImageToolkitBase.php @@ -19,7 +19,7 @@ * @inheritdoc */ public function apply($operation, ImageInterface $image, array $data = array()) { - $manager = \Drupal::service('image.toolkit.operation.manager'); + $manager = \Drupal::service('plugin.manager.image_toolkit_operation'); $plugin_id = $manager->getToolkitOperationPluginId($this->getPluginId(), $operation); $plugin = $manager->createInstance($plugin_id); return $plugin->apply($this, $image, $data); diff --git a/core/tests/Drupal/Tests/Core/Image/ImageTest.php b/core/tests/Drupal/Tests/Core/Image/ImageTest.php index 27c4d92..d81a811 100644 --- a/core/tests/Drupal/Tests/Core/Image/ImageTest.php +++ b/core/tests/Drupal/Tests/Core/Image/ImageTest.php @@ -219,7 +219,7 @@ public function testProcessInfoFails() { */ public function testScaleWidth() { $this->toolkit->expects($this->once()) - ->method('process') + ->method('apply') ->with($this->equalTo('resize')) ->will($this->returnArgument(2)); $result = $this->image->scale(44); @@ -231,7 +231,7 @@ public function testScaleWidth() { */ public function testScaleHeight() { $this->toolkit->expects($this->once()) - ->method('process') + ->method('apply') ->with($this->equalTo('resize')) ->will($this->returnArgument(2)); @@ -245,7 +245,7 @@ public function testScaleHeight() { public function testScaleSame() { // Dimensions are the same, resize should not be called. $this->toolkit->expects($this->never()) - ->method('process'); + ->method('apply'); $this->image->scale(88, 100); } @@ -255,7 +255,7 @@ public function testScaleSame() { */ public function testScaleAndCropWidth() { $this->toolkit->expects($this->exactly(2)) - ->method('process') + ->method('apply') ->with($this->logicalOr( $this->equalTo('resize'), $this->equalTo('crop') @@ -271,7 +271,7 @@ public function testScaleAndCropWidth() { */ public function testScaleAndCropHeight() { $this->toolkit->expects($this->exactly(2)) - ->method('process') + ->method('apply') ->with($this->logicalOr( $this->equalTo('resize'), $this->equalTo('crop') @@ -287,7 +287,7 @@ public function testScaleAndCropHeight() { */ public function testScaleAndCropFails() { $this->toolkit->expects($this->exactly(1)) - ->method('process') + ->method('apply') ->with($this->equalTo('resize')) ->will($this->returnValue(FALSE)); @@ -299,7 +299,7 @@ public function testScaleAndCropFails() { */ public function testCropWidth() { $this->toolkit->expects($this->once()) - ->method('process') + ->method('apply') ->with($this->equalTo('crop')) ->will($this->returnArgument(2)); // Cropping with width only should preserve the aspect ratio. @@ -312,7 +312,7 @@ public function testCropWidth() { */ public function testCropHeight() { $this->toolkit->expects($this->once()) - ->method('process') + ->method('apply') ->with($this->equalTo('crop')) ->will($this->returnArgument(2)); // Cropping with height only should preserve the aspect ratio. @@ -325,7 +325,7 @@ public function testCropHeight() { */ public function testCrop() { $this->toolkit->expects($this->once()) - ->method('process') + ->method('apply') ->with($this->equalTo('crop')) ->will($this->returnArgument(2)); $result = $this->image->crop(0, 0, 44, 50); @@ -337,7 +337,7 @@ public function testCrop() { */ public function testResize() { $this->toolkit->expects($this->exactly(2)) - ->method('process') + ->method('apply') ->with($this->equalTo('resize')) ->will($this->returnArgument(2)); // Resize with integer for width and height. @@ -353,7 +353,7 @@ public function testResize() { */ public function testDesaturate() { $this->toolkit->expects($this->once()) - ->method('process') + ->method('apply') ->with($this->equalTo('desaturate')); $this->image->desaturate(); } @@ -363,7 +363,7 @@ public function testDesaturate() { */ public function testRotate() { $this->toolkit->expects($this->once()) - ->method('process') + ->method('apply') ->with($this->equalTo('rotate')); $this->image->rotate(90); }