Commit graph

4 commits

Author SHA1 Message Date
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