Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
So Fake was broken and removed. But I still think a fake database driver for easier testing should be written.
Proposed resolution
This could be an extension of sqlite (can't be mysql/pgsql since you do not have the credentials). Here are the things this driver should do:
- Open should hardwire :memory:
- If select throws a table not found exception StatementEmpty should be returned.
- Insert/Merge should check for the table before execute and create it with the fields passed if necessary
- Update and Truncate should silently do nothing on a table not found exception
- Besides open, it should have a nice factory method which is already written in the migrate test case so that you can pass in an array and get a full database back.
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#3 | interdiff-2501763-2-3.txt | 7.7 KB | phenaproxima |
#3 | 2501763-3.patch | 9.94 KB | phenaproxima |
Comments
Comment #1
chx CreditAttribution: chx commentedComment #2
phenaproximaFirst attempt.
Comment #3
phenaproximaMade a few changes:
Comment #4
daffie CreditAttribution: daffie commentedIs this driver being tested somewhere or do does new tests to be added?
Comment #5
phenaproxima@daffie: It needs tests.
Comment #6
daffie CreditAttribution: daffie commented