Skip to content

Commit

Permalink
Added more test setup stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
rimi-itk committed Sep 12, 2024
1 parent b8ca01c commit a898734
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

* [PR-417](https://github.com/itk-dev/hoeringsportal/pull/417)
Added more test setup stuff

## [4.5.1] - 2024-09-06

* [PR-416](https://github.com/itk-dev/hoeringsportal/pull/416)
Expand Down
13 changes: 13 additions & 0 deletions web/modules/custom/hoeringsportal_deskpro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ not call an actual Deskpro API. Enable test mode in `settings.local.php`:
$settings['hoeringsportal_deskpro']['test_mode'] = TRUE;
```

and inject a little Deskpro configuration (cf. `/admin/site-setup/deskpro`):

``` shell name=deskpro-test-setup
docker compose exec phpfpm vendor/bin/drush sql:query "INSERT INTO key_value(collection, name, value) VALUES ('hoeringsportal_deskpro.config', 'deskpro_available_department_ids', '[1]') ON DUPLICATE KEY UPDATE value = '[1]'\G"
# Check that setting is as expected.
docker compose exec phpfpm vendor/bin/drush sql:query "SELECT * FROM key_value WHERE collection = 'hoeringsportal_deskpro.config' AND name = 'deskpro_available_department_ids'\G"
```

When in test mode, the Deskpro service will return data defined in [YAML
files](https://en.wikipedia.org/wiki/YAML) in the
[`src/Service/mock`](src/Service/mock) folder. (The `1` in the SQL incantations
above match `id: 1` in `src/Service/mock/ticket_departments.yaml`).

## Drush commands

```sh
Expand Down

0 comments on commit a898734

Please sign in to comment.