A while ago @euxpom made a WebTestCase helper method to put the contents of a Response in a html file placed inside the web folder of a symfony application. That was pretty cool, viewing application output with all the js and css in place, after a complex interaction. Yesterday I decided to do more and pimp it with some more automation.
So I added a Process call in order to make your favourite browser open the html output file straight from your virtual host.
Notice that the $domain parameter holds your virtual host name or base address (e.g. $this->saveOutput($client, null, 'foobar.lo');)
Here's the gist:
@_leopro_ liked it and added an hook to delete the html file after browser has started:
Here the process is started asynchronously, and you can fine tune the sleep time if your browser is opening too slowly.
If you like a synchronous approach, we can run the process and wait for it to complete to delete the file:
EDIT: Here comes @garakkio with some fixes: