Repository navigation
test: recorded contract fixtures to catch API/model drift - #67
Merged
Merged
Conversation
Add tools/record-fixtures.php (composer fixtures:record), which records read-only GET responses from the Billomat sandbox, anonymizes personal data with deterministic placeholders and stores them under tests/Fixtures/Contract/. ContractFixturesTest feeds every fixture through the real *Api method and fails on unknown fields or values lost during hydration (e.g. unknown enum values). Drift found and fixed: Client/Supplier now map the client-property-values and supplier-property-values Billomat returns, Role maps created/updated. User.rights stays a documented known drift.
justpilot
force-pushed
the
test/4x-contract-fixtures
branch
from
October 25, 2026 18:08
0baa44c to
db04aad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tools/record-fixtures.php(composer fixtures:record): read-only GETs against the sandbox (one list withper_page=3per resource, one single GET where data exists, plus sub-resources of the first entry). Hard cap of 150 requests; the full run took 72. Anonymizes names, companies, e-mails, phone numbers, addresses, bank data, tax/VAT ids, URLs, free texts, file contents and the Billomat ID with deterministic placeholders in the same format; types, enums, amounts, dates and ids stay unchanged.--cache=DIRreuses raw responses (outside the repo).tests/Fixtures/Contract/<resource>/<list|get>.json(51 resources).ContractFixturesTest(unit suite, no network): runs every fixture through the real*Apimethod and fails on unknown fields (non-empty$extra, recursively; for handwritten models: fieldstoArray()doesn't export) and on non-empty values lost during hydration (unknown enum values, unparsable dates, unknownpayment_typesentries). Accepted differences live inKNOWN_DRIFT; stale entries fail the test.docs/testing.md(re-recording, what is anonymized), CHANGELOG.Drift found
client-property-values/supplier-property-valuesare returned with every client/supplier but weren't mapped -> added to the codegen definitions asClient::$propertyValues/Supplier::$propertyValues(composer generate).Role(handwritten) ignoredcreated/updated-> added.User.rights(permission map likeRole::$permissions) stays inUser::$extrafor now: the generator has no map type yet. Documented inKNOWN_DRIFT.No unknown enum values were found in the recorded data. The sandbox has no offers, credit notes, reminders, letters, recurrings, incomings, articles or inbox documents, so those only have an (empty)
list.json; re-record once the sandbox has data.Checks
composer lint,analyse,refactor:dry,generate:check,test(3102 tests) andmutateon the diff (15/15 killed, 100 % MSI) pass locally.