We quite often need to support multiple database schemas for backward compatibility. Since this support may be maintained for a long time, we should have tests that ensure that our code works with the different schema versions. This is motivated by the MCR schema migration, but should help with any kind of schema change.
One way to achieve this is to have a method in MediaWikiTestCase which can be overwritten to return information about which tables are going to be altered, and which SQL files should be used to set up the target schema. This would mean that a test for a class that interacts with the database can have a subclass for each supported database schema.
Care must be taken to restore the original schema after each test class.