Skip to content

Commit 73d05c0

Browse files
committed
Explicitly unset images in tearDown()
1 parent d20ec0d commit 73d05c0

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

tests/ConvenienceTest.php

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ protected function setUp(): void
2424
$this->pixel = $this->image->getpoint(0, 0);
2525
}
2626

27+
protected function tearDown(): void
28+
{
29+
unset($this->image);
30+
unset($this->pixel);
31+
}
32+
2733
public function testVipsBandjoin()
2834
{
2935
$image = Vips\Image::newFromArray([[1, 2, 3], [4, 5, 6]]);

tests/ExceptionTest.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ class ExceptionTest extends TestCase
1212
*/
1313
private $image;
1414

15-
/**
16-
* The original value of pixel (0, 0).
17-
*/
18-
private $pixel;
19-
2015
protected function setUp(): void
2116
{
2217
$filename = __DIR__ . '/images/img_0076.jpg';
2318
$this->image = Vips\Image::newFromFile($filename);
24-
$this->pixel = $this->image->getpoint(0, 0);
19+
}
20+
21+
protected function tearDown(): void
22+
{
23+
unset($this->image);
2524
}
2625

2726
public function testVipsNewFromFileException()

tests/MetaTest.php

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ protected function setUp(): void
2626
$this->png_image = Vips\Image::newFromFile($png_filename);
2727
}
2828

29+
protected function tearDown(): void
30+
{
31+
unset($this->image);
32+
unset($this->png_image);
33+
}
34+
2935
public function testVipsSetGet()
3036
{
3137
$this->image->poop = 'banana';

tests/ShortcutTest.php

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ protected function setUp(): void
3737
$this->pixel = $this->image->getpoint(0, 0);
3838
}
3939

40+
protected function tearDown(): void
41+
{
42+
unset($this->image);
43+
unset($this->pixel);
44+
}
45+
4046
public function testVipsPow()
4147
{
4248
$real = self::mapNumeric($this->pixel, function ($value) {

0 commit comments

Comments
 (0)