title: PHPUnit Exception testing, error message messes up results output
body: <p>I can't seem to correctly do this, the error message of the exception just prints out, making the command line window harder to read. Below is how my code is structured and the test code.</p>
  
  <pre><code>public function availableFruits($fruit)
  {
    switch($fruit) {
      case 'foo':
      // all good
      break;
  
      case 'bar':
      // all good
      break;
  
      default:
      throw new Exception($fruit.' not available!');
      break;
  
    }
  }
  
  public function chooseFruit($fruit)
  {
    try {
      availableFruits($fruit);
    } catch (Exception $e) {
      echo $e-&gt;getMessage();
    }
  }
  
  public function testAvailableFruits()
  {
    $this-&gt;setExpectedException('Exception');
  
    chooseFruit('Kiwi');
  }
  </code></pre>
  
  <p>The error message will print out in the command line window like below. I tried all the methods shown in phpunit.de but same results.</p>
  
  <pre><code>..Error on line 13 in c:\file\path\fruits.php: Kiwi not available!.F
  </code></pre>
  
  <p>The error line prints out, how do I suppress that, am I doing it right at all?</p>