All unit tests are located in
tests/unit and are namespaced to match the class they are testing. E.g:
App\Services\General\ContactService is tested by
For tests to work, ensure that
Test is added as a suffix to the class and file name
Mocking and Mockery¶
Database State Management¶
Mail and PDF¶
Any emails sent from the development container should go to
mailtrap.io (send emails
using Edmonds Commerce internal if you can just to be safe).
When repeatedly polluting the database with test data from manual tests it is advisable to clean the database and rerun the test fixtures when developing. Laravel Doctrine comes with a useful entity definition library for very quickly generating entities on the fly, the fixtures use this system to generate dummy data for testing purposes.
All factory definitions are located in
database/factories/definitions.php and the main fixture class is
The current fixtures do not create projects and companies in the expected way (keeping true to Equip and Working Agreements etc).
To add the fixtures to the database:
To clean the database (before re-adding fixtures):
Acceptance Testing (Behat)¶
Before starting to run the acceptance tests, be sure that the following tasks have been completed
Ensure the database
projects_acceptanceexists (as per
.env.behat, this should already be on the cluster)
lxc-selenium ec-projects2command before executing tasks, this should be left running