Skip to content

test: cover what the plugin keeps after the webhook removal - #18

Merged
vitormattos merged 2 commits into
fix/drop-site-deploy-webhookfrom
test/cover-the-remaining-plugin
Nov 14, 2026
Merged

vitormattos merged 2 commits into
fix/drop-site-deploy-webhookfrom
test/cover-the-remaining-plugin

Conversation

@YvesCesar

Copy link
Copy Markdown
Member

Based on #17.

What was wrong

#17 removes the webhook receiver and the fragment sync, which were the most covered part of the plugin. Line coverage drops from 65.5% (the last report of main) to 45.4%, so the Coverage check fails current >= 65% && current >= prev. Most of what remains only runs with WooCommerce loaded, and the integration suite did not load it.

What changed

  • WooCommerce is installed by Composer from wpackagist into vendor/test-plugins/ and loaded before the plugin in the integration bootstrap, the same way as in woocommerce-nextcloud-admin-group-manager.
  • New integration tests for code that had none:
    • the deploy notices: shown once on the next admin screen, as success or error;
    • the settings page: the stored token is never printed, the repository is escaped, and users who cannot manage options are refused;
    • the rewrite rules for the account endpoints at the site root, the /my-account/ alias and the checkout order-pay/order-received routes, and when they are not registered;
    • the canonical redirect kept or skipped for root account endpoints;
    • the Nextcloud link on the account screen, only for signed-in customers with a host configured;
    • the invoice title, the payment methods and addresses sections on the billing screen, and the redirect of the addresses list.
  • tests/Support/RedirectTrap.php stops a redirect before the exit that follows it and records where it pointed.
  • README: WooCommerce is part of the integration suite now; Subscriptions is not, so the status change confirmation stays covered by the browser tests.

No plugin code changes.

Verification

composer ci green locally on PHP 8.3: lint, PHPCS, PHPStan and 170 tests. The unit suite still runs with no database. Line coverage: 367 of 481 lines, 76.3%.

Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
…ting

Signed-off-by: YvesCesar <yvesamorim73@gmail.com>
@vitormattos
vitormattos merged commit 03c8c5e into fix/drop-site-deploy-webhook Nov 14, 2026
22 checks passed
@vitormattos
vitormattos deleted the test/cover-the-remaining-plugin branch November 14, 2026 16:39
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.

2 participants