Our test suite contains tests and fixtures which execute MySQL specific DDL statements. In order to support alternative databases we need to abstract these statements to the
core/Db class or PDO adapter. Ideally tests and fixtures should never execute DDL statements directly.
Identify MySQL specific tests that only make sense to run on MySQL, adjust these tests to check which PDO adapter is in use and
markTestSkipped if not running the MySQL PDO adapter.
Non-db specific tests and fixtures that directly create tables or databases need to be abstracted to methods in
core/Db which could then abstract to the PDO adapter as needed.
Integration tests depend on the OmniFixture database dump which is MySQL specific:
Rename the OmniFixture dump based on the database adapter name is it suited for, ie.
getOmniFixtureFilename() method should be added to
core/Db/AdapterInterface this will return the OmniFixture filename to use so PDO Adapters can share the same dump if required. The standard Matomo MySQL PDO adapter should return
Integration testing code should use the chosen PDO Adapter
getOmniFixtureFilename() method to determine the OmniFixture data to load. Future PDO adapters can then override this method load data suitable for their schema.
Clean up the instructions and commands around generating new OmniFixture dumps.