Skip to content

Commit

Permalink
Add ddev phpunit guidance to REAME.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
finnlewis committed May 10, 2024
1 parent 4601c7c commit 0667d0e
Showing 1 changed file with 50 additions and 2 deletions.
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,58 @@ lando ssh
phpunit --filter=myTestName
```


## Running PHPUnit tests in DDEV

The included phpunit.xml.dist file contains configuration for automatically
running the LocalGov Drupal test suite.

The default .ddev/config.yml includes configuration for some extra domains that
ddev and phpunit will need to resolve different microsite domains.

When ddev starts, it will attempt to write these to /etc/hosts

If DDEV cannot write to /etc/hosts, you may need to add these manually.

If you are having problems runnign phpunit tests in DDEV, try adding the
following to `/etc/hosts`

```
127.0.0.1 group-1.web group-2.web group-3.web group-4.web group-5.web
```

To allow html output, manually create a directory for browser output.

```bash
mkdir web/sites/simpletest/browser_output
```

To run all LocalGov Drupal tests from inside DDEV:

```bash
ddev ssh
phpunit
```

To run all the tests for a specific module:

```bash
ddev ssh
phpunit web/modules/contrib/localgov_my_module
```

Tests can be filtered using the `--filter` option. To only run a specific test:

```bash
ddev ssh
phpunit --filter=myTestName
```


## Maintainers

This project is currently maintained by:
This project is currently maintained by:

- Ekes: https://www.drupal.org/u/ekes
- Finn Lewis: https://www.drupal.org/u/finn-lewis
- Stephen Cox: https://www.drupal.org/u/stephen-cox
- Stephen Cox: https://www.drupal.org/u/stephen-cox

0 comments on commit 0667d0e

Please sign in to comment.