Skip to content

test: run the customer controller tests against core-api 1.6.69 - #147

Merged
roncodes merged 1 commit into
release/v0.4.25from
fix/tests-against-core-1.6.69
Oct 14, 2026
Merged

roncodes merged 1 commit into
release/v0.4.25from
fix/tests-against-core-1.6.69

Conversation

@roncodes

Copy link
Copy Markdown
Member

Fixes PHP CI / build on #119 now that fleetbase/core-api 1.6.69 resolves and the suite runs against the real core for the first time. (Pest's own output does not reach the job log in this repo, so the failure was invisible there; locally with --log-junit the full suite is 789 tests, 0 failing with this change.)

Four tests in CustomerControllerContractsTest failed against the real core:

  1. Hashed, single-use codes. Codes sent by SMS are stored as an HMAC and used up when accepted, so the test can no longer read the plain code from the row. It now records the texts handed to the Twilio fake and reads the code from them; it gives the customer a phone on file first, since core texts the code to the phone on file; it checks the accepted code is marked used; and after the account deletion that is made to fail, it requests a fresh closure code, because the accepted one was burned. That also restores the Sentry capture count the test expects (SMS and email attempts both fail on the closure request).
  2. Two local verification_codes tables lacked the uuid and status columns that consume() writes.
  3. verifyCode() builds a form request from a plain request and validates it (setContainer(), setRedirector(), validateResolved()). The bootstrap's FormRequest stub now has those, deferring to the request's own failedValidation() so the 422 response is attached. illuminate/validation is added as a dev dependency: core-api only lists it under its own require-dev, so nothing installed it here and the test could not construct a validator.

No runtime code changes.

The suite never ran against the real core until it was tagged: PHP CI could not
resolve ^1.6.69. Against it, four tests in CustomerControllerContractsTest fail:

- codes sent by SMS are stored hashed and used up when accepted, so the test
  reads the plain code from the text the provider was handed instead of the
  row, gives the customer a phone on file so that text exists, checks the
  accepted code is marked used, and asks for a fresh closure code after the
  deletion that fails burned the first one
- two local verification_codes tables lacked the uuid and status columns that
  consume() writes
- verifyCode() builds a form request from a plain request and validates it;
  the bootstrap's FormRequest stub gains setContainer(), setRedirector() and
  validateResolved(), deferring to the request's own failedValidation() so the
  usual 422 response is attached, and illuminate/validation (a core dev
  dependency, not a runtime one) is now a dev dependency here too
@roncodes
roncodes merged commit 049d47f into release/v0.4.25 Oct 14, 2026
@roncodes
roncodes deleted the fix/tests-against-core-1.6.69 branch October 14, 2026 06: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