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
PHPUnit 6 removed some functions that were heavily used in version 4. To
be able to support both versions for a short time, we'll use a trait to
fill in the missing methods until we drop PHPUnit 4 support.
This trait is included in MediaWikiTestCase so most tests will be able
to benefit from it by default. Otherwise, anything that calls
setExpectedException() or getMock() will need to use it.
Change-Id: I707129e471e960e034e2aa994a467b9dc0239b69