tests: Support passing null to setExpectedException() in compat layer
[lhc/web/wiklou.git] / tests / phpunit / PHPUnit4And6Compat.php
index ac2c4f5..672ab4a 100644 (file)
@@ -30,7 +30,9 @@ trait PHPUnit4And6Compat {
         */
        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 );
                        }