diff --git a/README.md b/README.md index 942e9e4a..d1fa3562 100644 --- a/README.md +++ b/README.md @@ -471,6 +471,28 @@ And finally, run the tests: php artisan test --env=testing --filter {METHOD OR CLASS NAME} --coverage ``` +### Run the tests with the `run-tests.sh` script + +You can also run the tests using the `run-tests.sh` script, which is a wrapper around the PHPUnit command. + +```bash + chmod +x run-tests.sh + + ./run-tests.sh +``` + +This can also take any arguments (like the `--filter` or `--coverage` flag) that you would pass to the PHPUnit command. + +```bash + ./run-tests.sh --filter {METHOD OR CLASS NAME} +``` + +or + +```bash + ./run-tests.sh --coverage +``` + ## How to debug By using Docker Compose, you can debug the application by following these steps: diff --git a/run-tests.sh b/run-tests.sh new file mode 100755 index 00000000..b6807b62 --- /dev/null +++ b/run-tests.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Create a new database for testing +touch storage/database_testing.sqlite + +# Run the migrations and seed the database for testing +php artisan migrate:fresh --seed --env=testing --database=sqlite_testing + +# Run the tests with any additional arguments passed to the script +php artisan test --env=testing "$@" \ No newline at end of file