Skip to content

test: harden system tests (admin auth, order-independent asserts, stronger passwords)#58

Merged
nicdavidson merged 1 commit intodevelopfrom
test/system-tests-hardening
Apr 21, 2026
Merged

test: harden system tests (admin auth, order-independent asserts, stronger passwords)#58
nicdavidson merged 1 commit intodevelopfrom
test/system-tests-hardening

Conversation

@nicdavidson
Copy link
Copy Markdown
Contributor

Summary

  • SystemServiceTest: explicit sysadmin auth in setUp so list/get tests still pass under RBAC filtering; replace position-based assertions with assertContains.
  • AdminResourceTest: snapshot admin count before mutation and compare delta instead of asserting a fixed count; match user rows by name field instead of array index; upgrade fixture passwords to satisfy the stronger strength policy from the recent df-core / df-user security fixes.
  • UserResourceTestCase: matching password fixture upgrade.

Test plan

  • vendor/bin/phpunit tests/SystemServiceTest.php passes
  • vendor/bin/phpunit tests/AdminResourceTest.php passes
  • CI passes on this branch

…ertions, stronger passwords)

- SystemServiceTest: explicitly authenticate as sysadmin in setUp so the
  list/get tests still pass once RBAC filtering is enforced. Replace
  position-based asserts (`services.0.name == 'system'`) with
  `assertContains` so additional services in the DB don't flake the test.
- AdminResourceTest: don't assert fixed admin counts — snapshot the count
  before the mutation and compare deltas. Match user rows by the `name`
  field instead of array index. Upgrade hardcoded passwords to ones that
  satisfy the new strength policy so the security fixes in df-core and
  df-user don't cascade-break these tests.
- UserResourceTestCase: matching password upgrade for shared fixture.
@nicdavidson nicdavidson merged commit 74a55f2 into develop Apr 21, 2026
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