PHPUnit 4's setExpectedException() accepted null for the exception class
name to indicate that no exception would be thrown. PHPUnit 6's
expectException() is stricter and only allows strings.
Change-Id: I8c8783faec808a8f111af2ee533f5c61feccf099
*/
public function setExpectedException( $name, $message = '', $code = null ) {
if ( is_callable( [ $this, 'expectException' ] ) ) {
- $this->expectException( $name );
+ if ( $name !== null ) {
+ $this->expectException( $name );
+ }
if ( $message !== '' ) {
$this->expectExceptionMessage( $message );
}