Mercurial > hg > isophonics-drupal-site
comparison core/modules/image/tests/src/Functional/ImageEffectsTest.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
109 ]); | 109 ]); |
110 $this->assertToolkitOperationsCalled(['scale_and_crop']); | 110 $this->assertToolkitOperationsCalled(['scale_and_crop']); |
111 | 111 |
112 // Check the parameters. | 112 // Check the parameters. |
113 $calls = $this->imageTestGetAllCalls(); | 113 $calls = $this->imageTestGetAllCalls(); |
114 $this->assertEqual($calls['scale_and_crop'][0][0], 5, 'Width was computed and passed correctly'); | 114 $this->assertEqual($calls['scale_and_crop'][0][0], 7.5, 'X was computed and passed correctly'); |
115 $this->assertEqual($calls['scale_and_crop'][0][1], 10, 'Height was computed and passed correctly'); | 115 $this->assertEqual($calls['scale_and_crop'][0][1], 0, 'Y was computed and passed correctly'); |
116 $this->assertEqual($calls['scale_and_crop'][0][2], 5, 'Width was computed and passed correctly'); | |
117 $this->assertEqual($calls['scale_and_crop'][0][3], 10, 'Height was computed and passed correctly'); | |
118 } | |
119 | |
120 /** | |
121 * Test the image_scale_and_crop_effect() function with an anchor. | |
122 */ | |
123 public function testScaleAndCropEffectWithAnchor() { | |
124 $this->assertImageEffect('image_scale_and_crop', [ | |
125 'anchor' => 'top-1', | |
126 'width' => 5, | |
127 'height' => 10, | |
128 ]); | |
129 $this->assertToolkitOperationsCalled(['scale_and_crop']); | |
130 | |
131 // Check the parameters. | |
132 $calls = $this->imageTestGetAllCalls(); | |
133 $this->assertEqual($calls['scale_and_crop'][0][0], 0, 'X was computed and passed correctly'); | |
134 $this->assertEqual($calls['scale_and_crop'][0][1], 1, 'Y was computed and passed correctly'); | |
135 $this->assertEqual($calls['scale_and_crop'][0][2], 5, 'Width was computed and passed correctly'); | |
136 $this->assertEqual($calls['scale_and_crop'][0][3], 10, 'Height was computed and passed correctly'); | |
116 } | 137 } |
117 | 138 |
118 /** | 139 /** |
119 * Test the image_desaturate_effect() function. | 140 * Test the image_desaturate_effect() function. |
120 */ | 141 */ |