exceptions.php
public function expectException($expected = false, $message = '%s')
    {
        $this->expected = $this->forceToExpectation($expected);
        $this->message  = $message;
    }
public function expectException($expected = false, $message = '%s')
    {
        $this->expected = $this->forceToExpectation($expected);
        $this->message  = $message;
    }
Sets up an expectation of an exception.
This has the effect of intercepting an exception that matches.

@param SimpleExpectation $expected    Expected exception to match.
@param string $message                Message to display.