Commit graph

2 commits

Author SHA1 Message Date
Kunal Mehta
9d78fc2c87 tests: Support passing null to setExpectedException() in compat layer
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
2018-04-15 08:10:35 +00:00
Kunal Mehta
b34260f379 Provide PHPUnit 4 and 6 compatibility layer
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
2018-04-06 14:33:25 -07:00