title: UnitTest Error Controller in Zend Framework
body: <p>Iam a fan of 100% code coverage, but i have no idea how to test the ErrorController in Zend Framework.</p>
  
  <p>It is no problem to test the 404Action and the errorAction:</p>
  
  <pre><code>    public function testDispatchErrorAction()
      {
          $this-&gt;dispatch('/error/error');
          $this-&gt;assertResponseCode(200);
          $this-&gt;assertController('error');
          $this-&gt;assertAction('error');
      }
  
      public function testDispatch404()
      {
          $this-&gt;dispatch('/error/errorxxxxx');
          $this-&gt;assertResponseCode(404);
          $this-&gt;assertController('error');
          $this-&gt;assertAction('error');
      }
  </code></pre>
  
  <p>But how to test for an application error (500)?
  maybe i need something like this?</p>
  
  <pre><code>public function testDispatch500()
  {
      throw new Exception('test');
  
      $this-&gt;dispatch('/error/error');
      $this-&gt;assertResponseCode(500);
      $this-&gt;assertController('error');
      $this-&gt;assertAction('error');
  
  }
  </code></pre>