Skip to content

Add PHPUnit baseline test suite - #520

Open
sultann wants to merge 1 commit into
masterfrom
tests/phpunit-baseline
Open

Add PHPUnit baseline test suite#520
sultann wants to merge 1 commit into
masterfrom
tests/phpunit-baseline

Conversation

@sultann

@sultann sultann commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Adds a PHPUnit baseline test suite for Serial Numbers (free), characterizing current behavior before the b8 framework migration so the suite stays green through the port.

Harness

  • tests/bootstrap.php loads WooCommerce + the plugin (keeps CPT order storage)
  • tests/bin/install.sh provisions the WP + WooCommerce test environment
  • composer test:setup then composer test

Coverage (8 files, 42 tests)

  • EncryptionTest, KeyModelTest, OrderFulfillmentTest
  • RestApiValidateTest, RestApiActivateTest
  • StockTest, CronExpiryTest, InstallerTest

Risk-targeted: encryption round-trips, key model + encrypted lookup, order fulfillment lifecycle (assign/revoke/reuse/refund), the wcsn REST validate/activate/deactivate contract and permission gate, checkout stock guard, expiry cron, and installer state.

Note

The wcsn REST routes declare an invalid email schema type ('email'), which WordPress flags as doing_it_wrong; the baseline pins this. Worth fixing to type 'string' / format 'email'.

Run: composer install && composer test:setup && composer test

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