Skip to content
This repository was archived by the owner on May 18, 2024. It is now read-only.

Add cross-link to ProjectTests #4

Merged
merged 2 commits into from
Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PHPUnit testing scaffold for CodeIgniter 4 modules
## Overview

Not a module itself but a testing scaffold for CodeIgniter 4 modules,
**module-tests** makes it easy to setup PHPUnit tests in your modules.
**ModuleTests** makes it easy to setup PHPUnit tests in your modules.

To read more on Unit Testing in CodeIgniter 4 visit the
[User Guide](https://codeigniter4.github.io/userguide/testing/index.html).
Expand Down Expand Up @@ -74,3 +74,10 @@ in **build/logs/**.
## Code Coverage

See the docs on [Code Coverage](docs/COVERAGE.md).

## Project Testing

**ModuleTests** is designed to be added to your modular library which will be included into
other CodeIgniter 4 projects. If you are looking for a testing scaffold for applications
built using CodeIgniter 4 as their core framework, check out
[Codeigniter4Projects/ProjectTests](https://github.com/codeigniter4projects/project-tests).
8 changes: 4 additions & 4 deletions docs/COVERAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@

## Overview

**ci4-module-tests** comes preconfigured to handle code coverage in addition to the unit tests.
**ModuleTests** comes preconfigured to handle code coverage in addition to the unit tests.
You will need to have a code coverage driver installed to use this feature, such as
[Xdebug](https://xdebug.org).

## Setup

**ci4-module-tests** assumes your source code is in **src/**; if your code is somewhere else
**ModuleTests** assumes your source code is in **src/**; if your code is somewhere else
then you will need to modify the following line in your PHPUnit XML file:
```
<directory suffix=".php">./src</directory>
```

## PHPUnit.xml

**ci4-module-tests** includes a ready-to-use PHPUnit template in **phpunit.xml.dist**.
**ModuleTests** includes a ready-to-use PHPUnit template in **phpunit.xml.dist**.
Common practice is to create a local copy of this file as **phpunit.xml** and add any
sensitive or environment info (like database connections). Prevent **phpunit.xml** from
being tracked in your repo by adding it to **.gitignore**.
Expand All @@ -30,7 +30,7 @@ being tracked in your repo by adding it to **.gitignore**.

In addition to the code source mentioned above, PHPUnit can be configured to exclude files
that are not relevant to testing or would otherwise cause the coverage calculations to fail.
**ci4-module-tests** starts with a few files common to CodeIgniter 4 but you may need to add
**ModuleTests** starts with a few files common to CodeIgniter 4 but you may need to add
your own:
```
<exclude>
Expand Down