Relative newbie to PhpUnit and testing in general. We do not use migrations in our project, but have a couple of scripts that I need to run in order to set up the database for testing. How can I run mysql scripts from the project in the test pipeline? I also need to create a new database with a specific name before running those scripts.
Thanks!
OK, after some digging I found out how to do all this. Below is the script I used for testing with a new mysql schema created with specific user from a sql script. Hope this helps someone in the future.
$MYSQL_USERand$MYSQL_PASSWORDare replaced by Codeship - these are the env variables for the user and password for the mysql that exists in the build container.the
-eswitch on themysqlcall runs the script given and exits. Had to do it this way since I couldn't interact with the mysql client.