Demo All names and records here are made up, and the data resets every night. Please do not enter real personal information. ← Back to Find Care Scotland software · All software
Care Core

Documentation › Running it › Tests and demo data

Tests and demo data

How it is tested and how the demo works.

The automated tests

Care Core ships with a test suite that needs nothing installed beyond PHP and a test database:

DB_NAME=care_core_test php tests/run.php            # all domain tests
DB_NAME=care_core_test php tests/run.php leaver    # only tests whose name contains "leaver"

The runner rebuilds the test database from schema.sql at the start of every run and refuses to run against any database whose name does not contain “test”. Each test makes its own organisation, so tests never depend on each other.

What is covered

  • Lifecycle: the joiner, mover and leaver processes, all-or-nothing behaviour, rehires, events with no personal details, login access ending on the right day.
  • Teams and care: hierarchy loops, stints, staff-only teams, key worker rules, support episodes.
  • Staff records: field checks, encryption at rest, no values in logs or events, section isolation, self-service and approval (who can and cannot review), pictures and signatures, compliance records, what is due soon.
  • Consistency and events: the checks and their fixes, webhook signing, retries and filters, address rules.
  • SCIM: create, patch with Entra’s quirks, deprovision, reprovision.
  • Microsoft sign-in: a valid token, and every kind of forgery and replay (wrong issuer, audience, tenant, nonce, expiry, algorithm, tampering, state), account matching rules, no account creation.
  • Organisations: one organisation cannot see or approve another’s.

There are also end-to-end checks that drive the real web interface (sign-in, lock-out, forms, uploads, access control, SCIM over HTTP, escaping, security headers):

DB_NAME=care_core_demo DEMO_MODE=true php scripts/demo-reset.php
php -S localhost:8990 -t public public/index.php &
python3 tests/http_flows.py

The demo

php scripts/demo-reset.php drops every table, rebuilds the schema and seeds a fictional organisation, using the application’s own services (so the demo also proves they work). It refuses to run unless DEMO_MODE=true and the database name contains “demo”.

What you get: “Loch View Care (Demo)”, with nine teams in a hierarchy, sixteen staff (including a rehire, a former member of staff, someone leaving in three weeks and someone starting in nine days), nine people we support (one whose support has ended), key workers, needs and contacts, registrations (some due soon, one lapsed), supervisions, appraisals, training, a TUPE transfer, a visa, and a pending request from a member of staff waiting for their manager. The three sign-in accounts are in Signing in.

All names, numbers and records are invented. The National Insurance and bank numbers are obvious placeholders.