From a898734e742acbcefa8fb789066ae8efbcb25e08 Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Thu, 12 Sep 2024 09:29:11 +0200 Subject: [PATCH] Added more test setup stuff --- CHANGELOG.md | 3 +++ web/modules/custom/hoeringsportal_deskpro/README.md | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2620a825..5b1fa03a 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/web/modules/custom/hoeringsportal_deskpro/README.md b/web/modules/custom/hoeringsportal_deskpro/README.md index e8130002..031bc0bc 100644 --- a/web/modules/custom/hoeringsportal_deskpro/README.md +++ b/web/modules/custom/hoeringsportal_deskpro/README.md @@ -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