Unit Testing¶
Because zf-doctrine-audit uses stored procedures sqlite isn’t enough for unit testing. To setup unit testing follow these steps:
- Clone the repository outside of a project and cd into the repository directory.
- Run
docker-compose up -dto start a container to work in. You may need to install Docker if you’re not already using it. - Run
docker/connectto connect to a shell inside the container. - Run
composer installto install required libraries. - Run
vendor/bin/phpunitto execute the unit tests.
After the unit tests have ran the database will still exist.
Connect to mysql with mysql -u root -h mysql test to explore the database.
The audit database has the audit trails for the test data.
Manipulating data in the test database is immediatly audited in the audit database.