diff --git a/core/tests/Drupal/Tests/Core/Image/ImageTest.php b/core/tests/Drupal/Tests/Core/Image/ImageTest.php index 700973e..67ca501 100644 --- a/core/tests/Drupal/Tests/Core/Image/ImageTest.php +++ b/core/tests/Drupal/Tests/Core/Image/ImageTest.php @@ -219,7 +219,8 @@ public function testProcessInfoFails() { */ public function testScaleWidth() { $this->toolkit->expects($this->once()) - ->method('resize') + ->method('process') + ->with($this->equalTo('resize')) ->will($this->returnArgument(2)); $height = $this->image->scale(44); $this->assertEquals($height, 50); @@ -230,7 +231,8 @@ public function testScaleWidth() { */ public function testScaleHeight() { $this->toolkit->expects($this->once()) - ->method('resize') + ->method('process') + ->with($this->equalTo('resize')) ->will($this->returnArgument(1)); $width = $this->image->scale(NULL, 50); @@ -243,7 +245,8 @@ public function testScaleHeight() { public function testScaleSame() { // Dimensions are the same, resize should not be called. $this->toolkit->expects($this->never()) - ->method('resize') + ->method('process') + ->with($this->equalTo('resize')) ->will($this->returnArgument(1)); $width = $this->image->scale(88, 100); @@ -255,11 +258,13 @@ public function testScaleSame() { */ public function testScaleAndCropWidth() { $this->toolkit->expects($this->once()) - ->method('resize') + ->method('process') + ->with($this->equalTo('resize')) ->will($this->returnValue(TRUE)); $this->toolkit->expects($this->once()) - ->method('crop') + ->method('process') + ->with($this->equalTo('crop')) ->will($this->returnArgument(1)); $x = $this->image->scaleAndCrop(34, 50); @@ -271,11 +276,13 @@ public function testScaleAndCropWidth() { */ public function testScaleAndCropHeight() { $this->toolkit->expects($this->once()) - ->method('resize') + ->method('process') + ->with($this->equalTo('resize')) ->will($this->returnValue(TRUE)); $this->toolkit->expects($this->once()) - ->method('crop') + ->method('process') + ->with($this->equalTo('crop')) ->will($this->returnArgument(2)); $y = $this->image->scaleAndCrop(44, 40); @@ -287,11 +294,13 @@ public function testScaleAndCropHeight() { */ public function testScaleAndCropFails() { $this->toolkit->expects($this->once()) - ->method('resize') + ->method('process') + ->with($this->equalTo('resize')) ->will($this->returnValue(FALSE)); $this->toolkit->expects($this->never()) - ->method('crop'); + ->method('process') + ->with($this->equalTo('crop')); $this->image->scaleAndCrop(44, 40); } @@ -300,7 +309,8 @@ public function testScaleAndCropFails() { */ public function testCropWidth() { $this->toolkit->expects($this->once()) - ->method('crop') + ->method('process') + ->with($this->equalTo('crop')) ->will($this->returnArgument(4)); // Cropping with width only should preserve the aspect ratio. $height = $this->image->crop(0, 0, 44, NULL); @@ -312,7 +322,8 @@ public function testCropWidth() { */ public function testCropHeight() { $this->toolkit->expects($this->once()) - ->method('crop') + ->method('process') + ->with($this->equalTo('crop')) ->will($this->returnArgument(3)); // Cropping with height only should preserve the aspect ratio. $width = $this->image->crop(0, 0, NULL, 50); @@ -324,7 +335,8 @@ public function testCropHeight() { */ public function testCrop() { $this->toolkit->expects($this->once()) - ->method('crop') + ->method('process') + ->with($this->equalTo('crop')) ->will($this->returnArgument(3)); $width = $this->image->crop(0, 0, 44, 50); $this->assertEquals($width, 44); @@ -335,7 +347,8 @@ public function testCrop() { */ public function testResize() { $this->toolkit->expects($this->exactly(2)) - ->method('resize') + ->method('process') + ->with($this->equalTo('resize')) ->will($this->returnArgument(1)); // Resize with integer for width and height. $this->image->resize(30, 40); @@ -350,7 +363,8 @@ public function testResize() { */ public function testDesaturate() { $this->toolkit->expects($this->once()) - ->method('desaturate'); + ->method('process') + ->with($this->equalTo('desaturate')); $this->image->desaturate(); } @@ -359,7 +373,8 @@ public function testDesaturate() { */ public function testRotate() { $this->toolkit->expects($this->once()) - ->method('rotate'); + ->method('process') + ->with($this->equalTo('rotate')); $this->image->rotate(90); }