Move utility methods from ApiTestCase to MediaWikiTestCase