Skip to content

Testing ​

PHPUnit and Playwright need a local October install (src/app in the dev monorepo, PHP ≥ 8.4.1); DEV.md at the repository root explains the test servers. CI only runs typecheck, Vitest, the build and a freshness check of the committed assets/dist; run scripts/qa.sh for all gates, including PHPUnit and e2e.

PHPUnit ​

From the October install root (SQLite :memory:, array cache):

bash
php artisan plugin:test Renick.Content

Vitest (editor) ​

From plugins/renick/content:

bash
pnpm install
pnpm test              # vitest run
pnpm run test:coverage # with coverage gates
pnpm run test:unit     # React component tests (jsdom)

Coverage gates (statements/lines 85 %, functions 80 %, branches 75 %) apply to the pure logic only; Playwright covers the React UI.

Playwright (e2e) ​

Against a running dev server (scripts/serve.sh start, port 25567):

bash
cd tests-e2e
cp .env.example .env    # fill in RC_ADMIN_LOGIN / RC_ADMIN_PASSWORD
pnpm install
pnpm test

Suites that need their own install (test:flow, test:rainlab, test:compat, test:real-api) only run when their environment variable is set.

Backwards compatibility (October 4.1 to 4.3) ​

Tailor submission forms need October 4.4; on 4.1 to 4.3 the integration must be a no-op. The compat suite checks that against an older install:

bash
.claude/skills/fresh-testserver/compat.sh --october 4.2   # -> src/app-oct42, port 25569
(cd src/app-oct42 && PHP_CLI_SERVER_WORKERS=10 php artisan serve --host=127.0.0.1 --port=25569 --no-reload)
(cd tests-e2e && RC_OC43_BASE_URL=http://127.0.0.1:25569 pnpm run test:compat)

PHPUnit tests that need 4.4 skip themselves via InteractsWithTailorSubmissions. Put fixture blueprints with a 4.4-only type: in their own directory (tests/fixtures/blueprints-submission/): one invalid file makes BlueprintIndexer reject its whole datasource on 4.1 to 4.3.

PHPStan (level 5) ​

Run from the October install through an entrypoint that includes the real plugin directory, not the src/app/plugins symlink (the symlink causes phantom return.missing errors):

yaml
# src/app/phpstan-plugin.neon
includes:
    - vendor/larastan/larastan/extension.neon
    - ../../plugins/renick/content/phpstan.neon
bash
cd src/app
vendor/bin/phpstan analyse -c phpstan-plugin.neon