Skip to content

fix(tests): update test suite for ResolveSpace middleware + space context#57

Merged
Weegy merged 1 commit intomainfrom
hotfix/fix-test-suite
Mar 16, 2026
Merged

fix(tests): update test suite for ResolveSpace middleware + space context#57
Weegy merged 1 commit intomainfrom
hotfix/fix-test-suite

Conversation

@Weegy
Copy link
Copy Markdown
Contributor

@Weegy Weegy commented Mar 16, 2026

Problem

49 pre-existing test failures on main.

Root Causes

  1. phpunit.xml APP_BASE_PATH pointing to /tmp/quality-worktree (wrong migrations/controllers loaded - Laravel picked up stale worktree files)
  2. Duplicate space_id column in competitor_content_items migration
  3. WebhookAdminController::index() missing authorization check
  4. IDOR cross-space tests not sending correct X-Space-Id header

Fixes

  • Fix phpunit.xml APP_BASE_PATH to correct repo path
  • Remove duplicate space_id column from competitor_content_items migration
  • Add authz->authorize() check to WebhookAdminController::index()
  • Fix forbidden tests to use X-Space-Id header for cross-space IDOR testing
  • Regenerate autoloader

Quality Gates

  • ✅ pint: PASS
  • ✅ phpstan: PASS (0 errors)
  • ✅ tests: PASS (1255 passed, 0 failed, was 49 failed)

…text

- Fix phpunit.xml APP_BASE_PATH pointing to /tmp/quality-worktree (was loading
  wrong migrations/controllers, causing 49 test failures)
- Fix duplicate space_id column in competitor_content_items migration
- Add authorization check to WebhookAdminController::index()
  (no permission check existed; endpoint was open to any authenticated user)
- Fix cross-space IDOR tests to send X-Space-Id header for anotherSpace
  so webhook lookup correctly returns 404 when space_id does not match
- Regenerate autoloader to fix /tmp/competitor-worktree base path
@Weegy Weegy merged commit 28f86ae into main Mar 16, 2026
2 of 3 checks passed
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