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.

2 thoughts on “Codeception Database Helper”

  1. 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.

Leave a Reply

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