Skip to content

Commit 1760b09

Browse files
committed
docs: update about test database
1 parent 9546098 commit 1760b09

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

tests/README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,24 @@ for code coverage to be calculated successfully. After installing `XDebug`, you
3434
## Setting Up
3535

3636
A number of the tests use a running database.
37-
In order to set up the database edit the details for the `tests` group in
38-
**app/Config/Database.php** or **phpunit.xml**.
37+
The default configuration uses SQLite3 memory database, so it works if you can use SQLite3.
38+
39+
In order to change the database for testing, edit the details for the `tests` group in
40+
**app/Config/Database.php** or use **.env** file.
41+
42+
E.g.:
43+
```
44+
database.tests.hostname = localhost
45+
database.tests.database = ci4_test
46+
database.tests.username = root
47+
database.tests.password = root
48+
database.tests.DBDriver = MySQLi
49+
database.tests.DBPrefix = db_
50+
database.default.port = 3306
51+
```
52+
3953
Make sure that you provide a database engine that is currently running on your machine.
54+
4055
More details on a test database setup are in the
4156
[Testing Your Database](https://codeigniter4.github.io/CodeIgniter4/testing/database.html) section of the documentation.
4257

0 commit comments

Comments
 (0)