Skip to content

Commit b743fff

Browse files
authored
Merge pull request #8508 from kenjis/docs-update-starter/tests/README.md
docs: update starter/tests/README.md
2 parents 9a11804 + 826f163 commit b743fff

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

admin/starter/tests/README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use to test your application. Those details can be found in the documentation.
1414
## Requirements
1515

1616
It is recommended to use the latest version of PHPUnit. At the time of this
17-
writing we are running version 9.x. Support for this has been built into the
17+
writing, we are running version 9.x. Support for this has been built into the
1818
**composer.json** file that ships with CodeIgniter and can easily be installed
1919
via [Composer](https://getcomposer.org/) if you don't already have it installed globally.
2020

@@ -35,7 +35,7 @@ for code coverage to be calculated successfully. After installing `XDebug`, you
3535

3636
A number of the tests use a running database.
3737
In order to set up the database edit the details for the `tests` group in
38-
**app/Config/Database.php** or **phpunit.xml**.
38+
**app/Config/Database.php** or **.env**.
3939
Make sure that you provide a database engine that is currently running on your machine.
4040
More details on a test database setup are in the
4141
[Testing Your Database](https://codeigniter4.github.io/userguide/testing/database.html) section of the documentation.
@@ -92,12 +92,11 @@ HTML code coverage reports.
9292
## Test Cases
9393

9494
Every test needs a *test case*, or class that your tests extend. CodeIgniter 4
95-
provides a few that you may use directly:
96-
* `CodeIgniter\Test\CIUnitTestCase` - for basic tests with no other service needs
97-
* `CodeIgniter\Test\DatabaseTestTrait` - for tests that need database access
95+
provides one class that you may use directly:
96+
* `CodeIgniter\Test\CIUnitTestCase`
9897

99-
Most of the time you will want to write your own test cases to hold functions and services
100-
common to your test suites.
98+
Most of the time you will want to write your own test cases that extend `CIUnitTestCase`
99+
to hold functions and services common to your test suites.
101100

102101
## Creating Tests
103102

@@ -112,11 +111,8 @@ Review the links above and always pay attention to your code coverage.
112111

113112
### Database Tests
114113

115-
Tests can include migrating, seeding, and testing against a mock or live<sup>1</sup> database.
114+
Tests can include migrating, seeding, and testing against a mock or live database.
116115
Be sure to modify the test case (or create your own) to point to your seed and migrations
117116
and include any additional steps to be run before tests in the `setUp()` method.
118-
119-
<sup>1</sup> Note: If you are using database tests that require a live database connection
120-
you will need to rename **phpunit.xml.dist** to **phpunit.xml**, uncomment the database
121-
configuration lines and add your connection details. Prevent **phpunit.xml** from being
122-
tracked in your repo by adding it to **.gitignore**.
117+
See [Testing Your Database](https://codeigniter4.github.io/userguide/testing/database.html)
118+
for details.

0 commit comments

Comments
 (0)