diff --git a/core/modules/image/tests/src/Functional/ImageEffectsTest.php b/core/modules/image/tests/src/Functional/ImageEffectsTest.php index 2e8f2b1..f6b4ab3 100644 --- a/core/modules/image/tests/src/Functional/ImageEffectsTest.php +++ b/core/modules/image/tests/src/Functional/ImageEffectsTest.php @@ -111,10 +111,29 @@ public function testScaleAndCropEffect() { // Check the parameters. $calls = $this->imageTestGetAllCalls(); - $this->assertEqual($calls['scaleAndCropWithAnchor'][0][1], 0, 'X was computed and passed correctly'); - $this->assertEqual($calls['scaleAndCropWithAnchor'][0][2], 1, 'Y was computed and passed correctly'); - $this->assertEqual($calls['scaleAndCropWithAnchor'][0][3], 5, 'Width was computed and passed correctly'); - $this->assertEqual($calls['scaleAndCropWithAnchor'][0][4], 10, 'Height was computed and passed correctly'); + $this->assertEqual($calls['scale_and_crop'][0][0], 7.5, 'X was computed and passed correctly'); + $this->assertEqual($calls['scale_and_crop'][0][1], 0, 'Y was computed and passed correctly'); + $this->assertEqual($calls['scale_and_crop'][0][2], 5, 'Width was computed and passed correctly'); + $this->assertEqual($calls['scale_and_crop'][0][3], 10, 'Height was computed and passed correctly'); + } + + /** + * Test the image_scale_and_crop_effect() function with an anchor. + */ + public function testScaleAndCropEffectWithAnchor() { + $this->assertImageEffect('image_scale_and_crop', [ + 'anchor' => 'top-1', + 'width' => 5, + 'height' => 10, + ]); + $this->assertToolkitOperationsCalled(['scale_and_crop']); + + // Check the parameters. + $calls = $this->imageTestGetAllCalls(); + $this->assertEqual($calls['scale_and_crop'][0][0], 0, 'X was computed and passed correctly'); + $this->assertEqual($calls['scale_and_crop'][0][1], 1, 'Y was computed and passed correctly'); + $this->assertEqual($calls['scale_and_crop'][0][2], 5, 'Width was computed and passed correctly'); + $this->assertEqual($calls['scale_and_crop'][0][3], 10, 'Height was computed and passed correctly'); } /**