Skip to content

Commit

Permalink
Added a script for the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PavlosIsaris committed Dec 12, 2024
1 parent 7a77336 commit cecddcf
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 10 additions & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"

0 comments on commit cecddcf

Please sign in to comment.