Skip to content

Commit 211be64

Browse files
authored
Fixes memory leak on Annotations registry (#44324)
1 parent a44d197 commit 211be64

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Illuminate/Foundation/Testing/TestCase.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Mockery\Exception\InvalidCountException;
1919
use PHPUnit\Framework\ExpectationFailedException;
2020
use PHPUnit\Framework\TestCase as BaseTestCase;
21+
use PHPUnit\Util\Annotation\Registry;
2122
use ReflectionProperty;
2223
use Throwable;
2324

@@ -237,6 +238,11 @@ protected function tearDown(): void
237238
public static function tearDownAfterClass(): void
238239
{
239240
static::$latestResponse = null;
241+
242+
(function () {
243+
$this->classDocBlocks = [];
244+
$this->methodDocBlocks = [];
245+
})->call(Registry::getInstance());
240246
}
241247

242248
/**

0 commit comments

Comments
 (0)