Codeception Database Helper

I’ve been using Codeception for some acceptance testing recently. The project has a large database and using the standard Codeception database module that rebuilds the entire DB from an SQL dump was too slow.

All I needed to do was run a few queries to put some tables into a known state. I made a helper module that will run all .sql files in a directory.

I’ve put the DbHelper on Github and hopefully it will be useful for others.

This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to Codeception Database Helper

  1. Keyur says:

    thanks for this! I ended up using this over the regular dump.sql restore and it worked beautifully.

    It will take some work to get the sql files properly configured, but will be better than having to restore the full dump file. Which was taking a minute in my case with a bit of preexisting data.

  2. ian says:

    Glad you found it useful Keyur.

Leave a Reply

Your email address will not be published. Required fields are marked *