Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added more test setup stuff #417

Merged
merged 1 commit into from
Sep 12, 2024
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
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
Loading