Possible Duplicate:
How do you use PHPUnit to test a function if that function is supposed to kill PHP?
I'm writing some unit tests. The system I'm currently testing is a web-app in an MVC framework.
If we want to render pages without the site-skin system we've traditionally run our code as usual, but printed a "die();" statement at the end of the function to exit before the rest of the website renders.
Well now that we're adding unit testing, this seems to be a problem. You see, when you DIE(); in the MVC, that seems to send the same message to PHPUnit.
Grrrr... the code has now been rendered "Untestable"
Or has it?
How does one plan for a die(); In PHPUnit?
I know about adding this before a test:
/**
* @expectedException PHPUnit_Framework_Error
*/
but it doesn't allow me to test the variables as they were 'at time of death' (at least I don't think so)
Anyone able to enlighten me?
Thanks! :D