The ProcessPageView/Session classes are currently not very friendly in terms of usage inside a testing environment. They're using global calls to header() or session_start(), which do fail in test suites, where processwire is not the only/first thing running (and outputting data).
It would be nice if ProcessPageView could be used to just return the relevant data (output, status code, headers) in an object format for testing. Also the setup of a request could be streamlined, so one does not have to be so verbose as shown below.
Why would the enhancement be useful to users?
It would allow automated tests for the html markup rendered by ProcessWire.
Optional: Screenshots/Links that demonstrate the enhancement
Currently I'm playing with something like this in my testsuite (sessions disabled for now), but with those header() calls all over the place it's obviously not working.
Short description of the enhancement
The ProcessPageView/Session classes are currently not very friendly in terms of usage inside a testing environment. They're using global calls to header() or session_start(), which do fail in test suites, where processwire is not the only/first thing running (and outputting data).
It would be nice if ProcessPageView could be used to just return the relevant data (output, status code, headers) in an object format for testing. Also the setup of a request could be streamlined, so one does not have to be so verbose as shown below.
Why would the enhancement be useful to users?
It would allow automated tests for the html markup rendered by ProcessWire.
Optional: Screenshots/Links that demonstrate the enhancement
Currently I'm playing with something like this in my testsuite (sessions disabled for now), but with those header() calls all over the place it's obviously not working.