Skip to content

Maintenance – add ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_TIMEOUT env#126

Open
derpixler wants to merge 3 commits into
masterfrom
maintenance/rr/improve-unit-testing
Open

Maintenance – add ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_TIMEOUT env#126
derpixler wants to merge 3 commits into
masterfrom
maintenance/rr/improve-unit-testing

Conversation

@derpixler

Copy link
Copy Markdown
Contributor

What

Configurable request timeout for tests, Connection: close header to prevent Keep-Alive hangs, and connection_options support in the HTTP client.

Changes

src/HTTPClient.php

  • New connection_options key to pass arbitrary Guzzle options (headers, curl, etc.) through to the Guzzle client.
    test/.../AbstractBaseTest.php
  • ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_TIMEOUT — optional env variable, overrides request timeout (default: 30s).
  • connection_options with Connection: close — prevents HTTP connection reuse that hangs against local Zammad instances.

README.md

  • New ### Running tests section documenting all test env variables with a table and usage example.
    phpunit.xml.dist
  • Added ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_TIMEOUT to the documented env variables.

How to test

Set env variables for a running Zammad instance, then:
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_TIMEOUT=120 vendor/bin/phpunit

@derpixler derpixler self-assigned this Jun 8, 2026
@derpixler derpixler requested a review from mgruner June 9, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants