Level 1
But my code works without it
If you are using Laravels Testcase class, it's done for you; see https://github.com/laravel/framework/blob/ce3d25cb630015000599844ec78b1e8f3934bbdd/src/Illuminate/Foundation/Testing/TestCase.php#L184
3 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I see a lot of laravel packages uses Mockery::close(); in their test, But my code works without it, Why it necessary ?
protected function tearDown(): void
{
Mockery::close();
}
But my code works without it
If you are using Laravels Testcase class, it's done for you; see https://github.com/laravel/framework/blob/ce3d25cb630015000599844ec78b1e8f3934bbdd/src/Illuminate/Foundation/Testing/TestCase.php#L184
Please or to participate in this conversation.