Skip to content

test: promote the PHPUnit harness to main + CI (unit + integration)#60

Merged
WebTigers merged 3 commits into
mainfrom
test/harness-to-main
Jul 24, 2026
Merged

test: promote the PHPUnit harness to main + CI (unit + integration)#60
WebTigers merged 3 commits into
mainfrom
test/harness-to-main

Conversation

@WebTigers

Copy link
Copy Markdown
Owner

The keystone for the test backfill. The PHPUnit harness had been stranded on a local test-harness branch (never pushed, 20 commits behind main) while 9 unit-test files accumulated dormant on main — nothing to run them, no CI gate. That is how tests fell behind. This unions the two disjoint test sets onto main and makes tests first-class.

What lands

  • Harness: phpunit.xml, tests/bootstrap.php (PSR-0 Tiger_*/Zend_* autoload without a web boot), Tiger\Tests\Support\{Unit,Integration}TestCase (process-global registry isolation; the integration base migrates-once and self-skips when TIGER_TEST_DB_NAME is unset so composer test is safe locally), the composer test/test:unit/test:integration scripts, and require-dev: phpunit.
  • CI (.github/workflows/tests.yml): unit matrix PHP 8.1–8.5 + one integration job on a MariaDB 10.11 service, on push-to-main + every PR. Complements the existing gates (version-check, smoke, release-zip).
  • The 8 crypto/auth/gateway tests off test-harness (Tiger_Acl_Acl, Tiger_Ajax_ServiceFactory, Tiger_Auth_Totp, Tiger_Crypto, Tiger_Security, Tiger_Uuid + integration OrgUser, schema/model). With main's existing 9 → 17 files.
  • tests/COVERAGE-PLAN.md — the ~217-unit coverage manifest, refreshed with current status; the running backfill tracker.

Green

  • Unit: 128 tests / ~10.3k assertions.
  • Integration: 8 tests against real MariaDB (tiger_test).

Foundation for backfilling the priority spine (crypto/auth → gateway/ACL → tenant/model → install/RCE → media/storage → module services → satellite modules) toward the 1.0 @api-freeze gate.

🤖 Generated with Claude Code

WebTigers and others added 3 commits July 24, 2026 12:18
The harness had been stranded on a local test-harness branch while 9 unit-test files
accumulated dormant on main (nothing to run them, no CI). This unions the two disjoint
sets onto main and makes them first-class:

- Harness: phpunit.xml, tests/bootstrap.php (PSR-0 Tiger_*/Zend_* autoload, no web boot),
  Tiger\Tests\Support\{Unit,Integration}TestCase (registry isolation; migrate-once +
  env-gated self-skipping fixture DB), composer test/test:unit/test:integration scripts,
  require-dev phpunit.
- CI: .github/workflows/tests.yml — unit matrix (PHP 8.1-8.5) + one integration job on a
  MariaDB service. Runs on push to main + every PR (complements version-check/smoke/release-zip).
- Brings the 8 crypto/auth/gateway tests off test-harness (Acl, Ajax/ServiceFactory, AuthTotp,
  Crypto, Security, Uuid + 2 integration: OrgUser, schema/model). With main's existing 9
  (crypto-signature/license/module/agent) that's 17 files: 128 unit + 8 integration, all green.
- tests/COVERAGE-PLAN.md: the coverage manifest (refreshed) — the running backfill tracker.

Foundation for the test backfill toward the 1.0 @api-freeze gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ll (119 tests)

Three parallel no-DB unit clusters against the priority spine (COVERAGE-PLAN.md §5/§8):

- Media (38): Tiger_Media_Storage_Filesystem path-traversal guard (../, ../../, backslash,
  leading-slash — proven no byte escapes the root) + public/private root split (private url()='');
  the disk factory (memoized, default_disk fallback, unknown-adapter throw); Tiger_Media_Image
  never-upscale + contain math + MIME->GD map; Tiger_Media_Storage_S3 _fullKey traversal guard.
- CMS/routing/i18n (49): Tiger_Routing_Overrides reserved-prefix guard (api/auth/admin unclaimable
  at any priority) + priority-DESC sort + config-tier override; Tiger_Cms_Renderer trust-tier
  dispatch (html verbatim / phtml executes / md->Parsedown) + shortcode registry;
  Tiger_I18n_Country bias-sort + iso lookup fallback; Tiger_Location_Place ctor whitelist.
- Module install (32): Tiger_Module_Installer zip-slip/tar-slip guard (real malicious ZIP + ustar
  tar with ../, ../../../, absolute members — nothing escapes) + _validSlug + _readManifest +
  migrationPaths; Tiger_Module_Discovery capability detection + app-wins-collision + compat/requires
  passthrough; Tiger_Vendor sha256 gate + semver satisfies.

Full unit suite green: 247 tests / 10.6k assertions (exit 0). Two follow-ups surfaced + tracked
(not changed here): Tiger_Cms_Renderer markdown lacks Parsedown safe mode (raw HTML passes —
current behavior pinned by test); Tiger_Media_Image has 2 no-op imagedestroy() calls (8.5 deprecation).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… waves

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@WebTigers
WebTigers merged commit f6b7376 into main Jul 24, 2026
10 checks passed
@WebTigers WebTigers mentioned this pull request Jul 26, 2026
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