If an extension inserts data in an SQL file (that’s run in the LoadExtensionSchemaUpdates hook), how can that data be available in the (cloned, empty, temporary) tables used in phpunit tests?
It seems that when the test harness clones all database tables it only clones their structure and so any data inserted (i.e. what’s usually done when update.php is run) is not included.
At the moment, I’m thinking that it is meant to be done by calling e.g. Database::insert()
in MediaWikiTestCase::addDBDataOnce()
, and with only the required subset of data. But this feels a bit hacky; is it?