Commit graph

7 commits

Author SHA1 Message Date
Max Semenik
261190db7b PHPUnit4And6Compat tweaks
* Declare separate functions as deprecated to highlight their usages in
  IDEA.
* Remove pointless now conditions.

Change-Id: I760b8358bcc52656e8cfdf447f793e657f2a9c23
2019-10-04 19:28:38 -07:00
Max Semenik
9f8f95c1f9 PHPUnit4And6Compat: drop forward-compat functions
Bug: T192167
Change-Id: Iccdc5c965f3b6b59cfb4ec44764d0c7d9e9e4768
2019-10-04 00:30:58 -07:00
James D. Forrester
6a1c6cd86f tests: Require PHPUnit 6, drop PHPUnit 4 as an option
Bug: T192167
Change-Id: I060e589c3469806ab483197c9d9375eeaed7e532
2019-10-03 08:58:03 -07:00
daniel
94d559b149 Validate the output of the dump scripts.
This introduces XML schema validation into the unit tests for
the backup dump scripts. This is intended to ensure that the
output keeps conforming to the schema when updating XmlDumpWriter
and friends to support newer schema versions.

Bug: T174031
Change-Id: Iafa8cb8ba5b3684a08172e92974edaf0482f19b7
2019-03-20 22:25:20 +01:00
Leszek Manicki
ec12e3cc7b Added future compat expectException to PHPUnit4And6Compat trait
This allows PHPUnit 6 ready tests asserting
the exception that is to be thrown (as setExpectedException
is removed in PHPUnit 6).

Bug: T208389
Change-Id: I13c58f37671092583a7fdfed7ccee9c2a4ecb136
2019-02-04 15:07:45 +00:00
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