Skip to content

TWO-24748/feat: Brand-code plumbing and test target for the dev harness#33

Open
dgjlindsay wants to merge 7 commits into
doug/TWO-24746-brand-configfrom
doug/TWO-24748-dev-harness
Open

TWO-24748/feat: Brand-code plumbing and test target for the dev harness#33
dgjlindsay wants to merge 7 commits into
doug/TWO-24746-brand-configfrom
doug/TWO-24748-dev-harness

Conversation

@dgjlindsay

Copy link
Copy Markdown
Contributor

What

D2 of the plugin parity plan (TWO-24739 → TWO-24748). Ticket premise correction: the dev harness (Makefile with install/configure/proxy targets, compose stack, dev/configure.php, .env.local.example) already exists from earlier work — the ticket predates it. The actual gaps:

Stacked on #32 (needs the PS_TWO_BRAND_CODE brand seam).

  • TWO_BRAND_CODE plumbed end-to-end: .env.local.examplemake configuredev/configure.phpPS_TWO_BRAND_CODE configuration value (which the TWO-24746 loader resolves to brands/{code}.php). Included in configure.php's duplicate-row pruning.
  • make test: runs tests/run.php in a php:8.2 container — same suite as CI.

Test-coverage audit (ticket scope): tests/run.php (TinyAssert harness, dependency-free) covers order composition, tax/discount edge cases, brand config, and address formatting; CI (tests.yml) lints + runs it on every PR. "Establish PHPUnit baseline" is superseded — phpunit.xml.dist remains a stub for future adoption.

Test plan

  • php -l dev/configure.php
  • make test green
  • make install && make configure TWO_BRAND_CODE=two on a dev box; confirm PS_TWO_BRAND_CODE row written once

🤖 Generated with Claude Code

The ticket's 'no Makefile or Docker setup' premise predates the
harness — Makefile (install/configure/run/debug/stop/flush/clean/
proxy/logs), compose stack, dev/configure.php and .env.local.example
all exist. The actual delta:

- TWO_BRAND_CODE env var plumbed through .env.local.example, the
  configure target and dev/configure.php, writing the
  PS_TWO_BRAND_CODE configuration value the brand loader (TWO-24746)
  resolves to brands/{code}.php. Added to the dedup key list.
- make test: runs the tests/run.php harness in a php:8.2 container —
  the same suite CI runs. The ticket's 'establish PHPUnit baseline'
  is superseded by that harness (phpunit.xml.dist remains as a stub
  for a future PHPUnit adoption; the harness is deliberately
  dependency-free).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

dgjlindsay and others added 6 commits June 11, 2026 06:41
- The brands/two.php header now states PS_TWO_BRAND_CODE is the
  PRODUCTION selection mechanism and cross-references WooCommerce's
  dev-only TWO_BRAND_CODE env var — near-identical names for different
  mechanisms was flagged as the cross-plugin confusion trap.
- The vendor_name 'cross-plugin precedent' wording was misleading:
  WooCommerce sends the field from a merchant gateway option, not
  brand config. Both comments now state the source divergence (the
  semantic decision is recorded in the parity plan).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The checkout-api schema defines vendor_name as the marketplace
SELLER reference ('used to refer to the seller in a marketplace
setup') rendered on buyer invoices via Njord — a per-merchant
declaration, which is exactly how the WooCommerce plugin sources it
(gateway option). A brand is not a marketplace seller; the ticket's
'vendor_name from brand config' premise was wrong, and although the
Two brand shipped it inert (empty value, never sent), the mechanism
invited a partner edition to mislabel every merchant's invoices. The
key, the injector and its three call sites are gone; the real-builder
test still pins that brand machinery never adds identity keys to the
body. PrestaShop gaining real vendor_name support (a merchant
setting, WC-style) is a separate parity gap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Conflict resolution: gate tests join the run list; the vendor_name
payload-identity tests stay removed (this branch removed the
mechanism).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Conflict resolution: gate tests join the run list; the removed
vendor_name payload-identity tests stay removed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Conflict resolution keeps this branch's removal of the brand
vendor_name payload-identity mechanism while adding the new
platform-minimum conversion test and harness exposer.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Conflict resolution keeps this branch's removal of the payload-identity
tests while adding the decline-hint test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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