-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dedicated README explaining how to run tests
- Loading branch information
1 parent
f88565c
commit 424328d
Showing
2 changed files
with
56 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Running Tests | ||
============= | ||
|
||
Before running the test suite, you first need to install dev dependencies: | ||
|
||
```bash | ||
composer install --dev | ||
``` | ||
|
||
Then you can run the test suite with different configuration (SQLite, MySQL or PostgreSQL): | ||
|
||
#### Default configuration (SQLite) | ||
|
||
This configuration uses an in memory sqlite database, it's the fastest configuration. | ||
|
||
```bash | ||
./vendor/bin/phpunit | ||
``` | ||
or | ||
```bash | ||
./vendor/bin/phpunit -c tests/travis/sqlite.travis.xml | ||
``` | ||
|
||
#### MySQL configuration | ||
|
||
This configuration expects to connect to a MySQL database. | ||
|
||
```bash | ||
./vendor/bin/phpunit -c tests/travis/mysql.travis.xml | ||
``` | ||
|
||
**Note**: connection parameters (username, password, host, port, etc) are set in `./tests/travis/mysql.travis.xml` file. | ||
|
||
Assuming you have docker installed, you can easily start a MySQL server with following command (MySQL 8) | ||
|
||
```bash | ||
docker run --name mysql_db -e MYSQL_DATABASE=doctrine_audit -d -p 3306:3306 mysql --default-authentication-plugin=mysql_native_password | ||
``` | ||
|
||
|
||
#### PostgreSQL configuration | ||
|
||
This configuration expects to connect to a PostgreSQL database. | ||
|
||
```bash | ||
./vendor/bin/phpunit -c tests/travis/pgsql.travis.xml | ||
``` | ||
|
||
**Note**: connection parameters (username, password, host, port, etc) are set in `./tests/travis/pgsql.travis.xml` file. | ||
|
||
Assuming you have docker installed, you can easily start a PostgreSQL server with following command (PostgreSQL 11) | ||
|
||
```bash | ||
docker run --name postgres_db -e POSTGRES_DB=doctrine_audit -d -p 5432:5432 postgres | ||
``` |