Repository navigation
test: check PHP inside FrankenPHP, cover install checks, tidy test files - #75
Merged
Merged
Conversation
## Short Summary (TL;DR) Tests now check PHP inside FrankenPHP (not only `ddev php`), cover the install checks, and are shorter, with clearer test file names. ## The Issue Most PHP checks ran through `ddev php` (the command line), which doesn't prove FrankenPHP sees the same settings. `HTTPS` behind the router, `ddev xdebug on` reaching FrankenPHP, worker state and the `install.yaml` checks were untested. `health_checks` also repeated the same header checks four times. ## How This PR Solves The Issue - **New `server-info.php`:** prints settings as FrankenPHP sees them. Tests use it to check: - `sapi=frankenphp` - `HTTPS`, `SERVER_PORT` and `REQUEST_SCHEME` through the router and through the direct host ports - timezone and `.ddev/php` ini settings - extensions, including after `ddev xdebug`, `xhprof` and `blackfire on` - `memory_limit` from `FRANKENPHP_CONFIG` - **Worker test:** checks that `X-Request-Count` grows between requests. - **`ddev logs -s web`:** must not contain the "Caddyfile input is not formatted" warning. - **New test:** `ddev add-on get` must reject PHP 8.1 and an old `FRANKENPHP_DEBIAN_CODENAME` in `.ddev/.env.web`. - **`health_checks`:** now uses small helpers (`refute_php_warnings`, `assert_frankenphp_headers`, `assert_server_info`) and one extension list, one name per line. - **Test file renames:** - `index-no-worker.php` → `index.php` - `index-worker.php` → `worker.php`, cut from 225 to 16 lines - `session-test.php` → `session.php` ## Manual Testing Instructions ```bash bats tests/test.bats --filter-tags '!release' ``` ## Automated Testing Overview The PR only changes tests. ## Release/Deployment Notes None, the add-on itself is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short Summary (TL;DR)
Tests now check PHP inside FrankenPHP (not only
ddev php), cover the install checks, and are shorter, with clearer test file names.The Issue
Most PHP checks ran through
ddev php(the command line), which doesn't prove FrankenPHP sees the same settings.HTTPSbehind the router,ddev xdebug onreaching FrankenPHP, worker state and theinstall.yamlchecks were untested.health_checksalso repeated the same header checks four times.How This PR Solves The Issue
server-info.php: prints settings as FrankenPHP sees them. Tests use it to check:sapi=frankenphpHTTPS,SERVER_PORTandREQUEST_SCHEMEthrough the router and through the direct host ports.ddev/phpini settingsddev xdebug,xhprofandblackfire onmemory_limitfromFRANKENPHP_CONFIGX-Request-Countgrows between requests.ddev logs -s web: must not contain the "Caddyfile input is not formatted" warning.ddev add-on getmust reject PHP 8.1 and an oldFRANKENPHP_DEBIAN_CODENAMEin.ddev/.env.web.health_checks: now uses small helpers (refute_php_warnings,assert_frankenphp_headers,assert_server_info) and one extension list, one name per line.index-no-worker.php→index.phpindex-worker.php→worker.php, cut from 225 to 16 linessession-test.php→session.phpManual Testing Instructions
bats tests/test.bats --filter-tags '!release'Automated Testing Overview
The PR only changes tests.
Release/Deployment Notes
None, the add-on itself is unchanged.
🤖 Generated with Claude Code