donatj / mock-webserver

Simple mock web server in PHP for unit testing.
MIT License
131 stars 21 forks source link

Add DelayResponse support to ResponseStack #56

Closed Jarlakxen closed 11 months ago

Jarlakxen commented 12 months ago

Hi!

I added the capability to honor the DelayedResponse when it is inside a ResponseStack. I'm was trying to test the retry behavior on my app, so I needed to emulate 1 response with high delay than the second one in other to only trigger the timeout in the first one.

donatj commented 12 months ago

Thanks for the PR! I actually ran into a similar issue recently and have been considering rewriting the way the response stacks work from the ground up to fix these sorts of issues.

I'm not sure if my idea is practical though. I'll review this when I get some time on the computer in the next day or so.

donatj commented 11 months ago

Thank you again for the great PR.

My ideas are breaking changes and a ways out whereas this is a very practical fix for the time being. I am very happy to accept this.

donatj commented 11 months ago

It now exists in tab v2.7.0 - https://github.com/donatj/mock-webserver/releases/tag/v2.7.0