title: PHPUnit: continue after die, expect "die" or somehow handle die()?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1347794/how-do-you-use-phpunit-to-test-a-function-if-that-function-is-supposed-to-kill-p">How do you use PHPUnit to test a function if that function is supposed to kill PHP?</a>  </p>
  </blockquote>
  
  
  
  <p>I'm writing some unit tests.  The system I'm currently testing is a web-app in an MVC framework.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>Grrrr... the code has now been rendered "Untestable" </p>
  
  <p>Or has it?</p>
  
  <p>How does one plan for a die();  In PHPUnit?</p>
  
  <p>I know about adding this before a test:</p>
  
  <pre><code>/**
   * @expectedException PHPUnit_Framework_Error
   */
  </code></pre>
  
  <p>but it doesn't allow me to test the variables as they were 'at time of death' (at least I don't think so)</p>
  
  <p>Anyone able to enlighten me? </p>
  
  <p>Thanks!
  :D</p>