Codeception - Integration testing a package with eloquent
Anyone have any tips for integration testing a package with Eloquent models? I am using codeception with an SQLite database. I'm bootstrapping Eloquent in the codeception _bootstrap file and just pointing it to the same sqlite database I setup in the codeception Db module.
Here is the issue: Codeception and Eloquent are using different PDO connections. This causes an issue where I migrate the database, but the codeception Db module complains that the schema was changed. Anyone know how to get the codeception Db module's PDO connection to pass to eloquent?
If anyone else is trying this, I used the Dbh module instead of the Db module. The Dbh module allows you to set the PDO instance for codeception in your bootstrap file.
First, build up the capsule and set the connection.