Welcome Guest, Not a member yet? Register   Sign In
Running automated tests with mysql database possible?
#1

After successful deployment I am now trying to add testing to my project and I require a couple of tables in the mysql database. The tests shipped with the CI4 distro all use sqlite3 memory-based database and I have tried adopt the tests for mysql.
I have setup migrations for the tables I need and some seed files as well. They seems to be working when running in the 

I have stumbled over a couple of things I don't understand and wonder if someone could shed some light:
1) If I set $refresh = true in my extended DatabaseTestCase class, the setup with migration and seeds are run before every single test in the file, time consuming. However, setting $refresh = false doesn't run the migrations but runs the seeds so the tables are not setup and possibly key collisions when running the same seed again. 
With $refresh = false - how should I run the migrations to setup the test database?

2) Took me some time to find the overridden envs in phpunit.xml.dist to use sqlite3. 
Why are they there?

Thanks,
/Mattias
Reply


Messages In This Thread
Running automated tests with mysql database possible? - by tgix - 03-01-2020, 02:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB