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

Rightsum's avatar

Multiple calls in one test without using $this->refreshApplication()

I'm going to test a procedure and want to call 3 of my API endpoints sequentially which is discussed here . The problem is I have to call $this->refreshApplication() after each $this->call() to make it work, by calling $this->refreshApplication the database transaction rolls back and ruins my test .

How can I solve this ? is there any better workaround instead of calling $this->refreshApplication() ?

Thanks

0 likes
4 replies
luceos's avatar

Why are you calling refreshApplication() what do you achieve with it?

1 like
Rightsum's avatar

Thanks for your reply. You can see this post, I'm going to achieve the same result. Ex: getting the token from my auth endpoint and then send a request to one my resources.

Rightsum's avatar

For the time being, I removed the use DatabaseTransactions; in my Tests and now they're working fine. Any suggestions ?

Please or to participate in this conversation.