Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

axeloz's avatar

PHP Unit testing very slow

Hello, Quick question: my Unit tests are working fine. But I needed to clear some stuff after tests. But I noticed that my tests became VERRRRRRRY long whenever I added the tearDown() method. I tried to simplify the tearDown() actions until I simply cleared out the method:

	public function tearDown():void {
		//Cashier::stripe()->customers->delete($this->user->stripe_id);
		//echo 'BYE';
	}

It seems that even empty the tearDown is slowing down tests : I waited 5 minutes to complete and I didn't go through when it usually takes 30/45s without tearDown. Has anyone noticed such behavior? Thanks

0 likes
3 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Any change if you add parent::tearDown();

Without it, you are removing the teardown of laravel

axeloz's avatar

Yes ! Thanks @sinnbeck I should have thought about this as it is required for setUp(). Plus it's in the documentation :-( my bad.

Please or to participate in this conversation.