Skip to content

Commit 78bbdb6

Browse files
committed
Fix tests
1 parent 6745765 commit 78bbdb6

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/Modifiers/TextModifier.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -201,28 +201,27 @@ private function maybeRotateText(VipsImage $text): VipsImage
201201
};
202202
}
203203

204-
/**
205-
* Draw debug information for given position and given rectangle size
206-
*
207-
* @throws RuntimeException
208-
*/
204+
/** @phpstan-ignore method.unused */
209205
private function debugPos(ImageInterface $image, PointInterface $position, Rectangle $size): void
210206
{
211207
// draw pos
208+
// @phpstan-ignore missingType.checkedException
212209
$image->drawCircle($position->x(), $position->y(), function (CircleFactory $circle): void {
213210
$circle->diameter(8);
214211
$circle->background('red');
215212
});
216213

217214
// draw points of size
218215
foreach (array_chunk($size->toArray(), 2) as $point) {
216+
// @phpstan-ignore missingType.checkedException
219217
$image->drawCircle($point[0], $point[1], function (CircleFactory $circle): void {
220218
$circle->diameter(12);
221219
$circle->border('green');
222220
});
223221
}
224222

225223
// draw size's pivot
224+
// @phpstan-ignore missingType.checkedException
226225
$image->drawCircle($size->pivot()->x(), $size->pivot()->y(), function (CircleFactory $circle): void {
227226
$circle->diameter(20);
228227
$circle->border('blue');

tests/Unit/FontProcessorTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function testBoxSizeTtf(): void
2323

2424
$this->assertInstanceOf(SizeInterface::class, $size);
2525
$this->assertEquals(155, $size->width());
26-
$this->assertEquals(43, $size->height());
26+
$this->assertEquals(44, $size->height());
2727
}
2828

2929
public function testNativeFontSize(): void
@@ -46,21 +46,21 @@ public function testTypographicalSize(): void
4646
{
4747
$processor = new FontProcessor();
4848
$result = $processor->typographicalSize($this->testFont());
49-
$this->assertEquals(12, $result);
49+
$this->assertEquals(13, $result);
5050
}
5151

5252
public function testCapHeight(): void
5353
{
5454
$processor = new FontProcessor();
5555
$result = $processor->capHeight($this->testFont());
56-
$this->assertEquals(9, $result);
56+
$this->assertEquals(10, $result);
5757
}
5858

5959
public function testLeading(): void
6060
{
6161
$processor = new FontProcessor();
6262
$result = $processor->leading($this->testFont());
63-
$this->assertEquals(15, $result);
63+
$this->assertEquals(16, $result);
6464
}
6565

6666
private function testFont(): Font

0 commit comments

Comments
 (0)