Skip to content

test: check PHP inside FrankenPHP, cover install checks, tidy test files - #75

Merged
stasadev merged 1 commit into
mainfrom
20261008_stasadev_tests
Oct 8, 2026
Merged

stasadev merged 1 commit into
mainfrom
20261008_stasadev_tests

Conversation

@stasadev

@stasadev stasadev commented Oct 8, 2026

Copy link
Copy Markdown
Member

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

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

## 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>
@stasadev
stasadev merged commit efb78d0 into main Oct 8, 2026
12 checks passed
@stasadev
stasadev deleted the 20261008_stasadev_tests branch October 8, 2026 12:04
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.

1 participant