title: PHPUnit doesn't catch expected exceptions
body: <p>I have a set of tests, and I want to test that my classes throw exceptions at the right time. In the example, my class uses the __get() magic method, so I need to test that an exception is thrown when an invalid property is retrieved:</p>
  
  <pre><code>function testExceptionThrownWhenGettingInvalidProperty() {
    $obj = new MyClass();
    $this-&gt;setExpectedException("Property qwerty does not exist");
    $qwerty = $obj-&gt;qwerty;
  }
  </code></pre>
  
  <p>The class throws an error as it should, but instead of just getting a pass, the exception isn't caught!</p>
  
  <pre><code>There was 1 error:
  
  1) QueryTest::testExceptionThrownWhenGettingInvalidProperty
  Exception: Property qwerty does not exist
  </code></pre>
  
  <p>I was using SimpleTest before, and <code>$this-&gt;expectException(new Exception("Property qwerty does not exist"));</code> worked just fine. I know there are other methods (@expectedException and try-catch), but this one should work and it looks a lot cleaner. Any ideas how I can make this work?</p>