ci: guard against undefined PRAUTOBLOGGER_* constants (#165)
Adds scripts/check-constants.php + a required ci.yml step that fails the build when any referenced PRAUTOBLOGGER_* constant is neither defined in prautoblogger.php nor defined()-guarded. Closes the v0.19.0 admin-500 incident class (seq 38). CI-only; no plugin runtime change. QA: APPROVE-WITH-P2-NOTES (2026-06-14-923f712). P2 follow-ups folded into M4. Agent-Session: ci-constants-guard-20260614
This commit is contained in:
17
.github/workflows/ci.yml
vendored
17
.github/workflows/ci.yml
vendored
@@ -109,3 +109,20 @@ jobs:
|
||||
run: composer install --no-progress --no-interaction --prefer-dist
|
||||
- name: Run PHPUnit (Brain Monkey — no WP install required)
|
||||
run: vendor/bin/phpunit --testdox
|
||||
|
||||
check-constants:
|
||||
name: Check PRAUTOBLOGGER_* constants
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup PHP 8.1
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.1'
|
||||
coverage: none
|
||||
- name: Check PRAUTOBLOGGER_* constants
|
||||
# Fails if any PRAUTOBLOGGER_* constant referenced in the shipped
|
||||
# plugin PHP is neither defined in prautoblogger.php nor guarded
|
||||
# by defined() at the reference site. Prevents the v0.19.0 incident
|
||||
# class (constant deleted from bootstrap, test fallback masks the gap).
|
||||
run: php scripts/check-constants.php
|
||||
|
||||
Reference in New Issue
Block a user