Testing the OrgManager Development Version

We use the Laravel testing functionalities and PHPUnit to add automated testing to OrgManager.

Setting up the testing enviroment

By default, the tests will run in a special database called orgmanager_test in localhost with username root and password root. If you need to change this, edit the .env.testing file. This is an example of a customized .env.testing file:

envCopy to clipboard
APP_ENV=testing # don't change this!
APP_KEY=base64:GIkaQ57IIVtTeTQOIh7eAFo1FAcoWkfwYPkfcOyusW4= # this is autogenerated


DB_TEST_HOST=database_host # the testing database host (probably localhost)
DB_TEST_DATABASE=database_name # the testing database name
DB_TEST_USERNAME=database_username # the testing database username
DB_TEST_PASSWORD=database_password # the testing database password

CACHE_DRIVER=array # you shouldn't need to change this
SESSION_DRIVER=array # you shouldn't need to change this
QUEUE_DRIVER=sync # you shouldn't need to change this

Once you've customized your .env.testing file, you have to migrate the database to your test database. You can do this by running

bashCopy to clipboard
php artisan migrate --env=testing

Running the tests

To run the tests, run

bashCopy to clipboard
composer test