Merge "tests: Support passing null to setExpectedException() in compat layer"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 15 Apr 2018 18:48:10 +0000 (18:48 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 15 Apr 2018 18:48:10 +0000 (18:48 +0000)
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 );
                        }