Skip to content

Warn on a helper-derived property id; reject DSN credentials - #18

Merged
rasuvaeff merged 2 commits into
masterfrom
fix/indirect-id-warning-and-dsn-credentials
Aug 20, 2026
Merged

Warn on a helper-derived property id; reject DSN credentials#18
rasuvaeff merged 2 commits into
masterfrom
fix/indirect-id-warning-and-dsn-credentials

Conversation

@rasuvaeff

Copy link
Copy Markdown
Owner

Closes #14, #15.

#14 helper-derived id (MEDIUM)

forAll() derives the property id from its caller. Called from a helper method (not the test method), that id names the helper — so every test routing through the helper shares one corpus entry and prunes the others' regression, with no warning (the id looks stable, it's just the wrong method). It now warns on stderr, the way a closure-derived id already did; ->id() silences it. The signal is a mismatch between the backtrace-derived method and TestCase::name() (allowed in psalm.xml alongside the adapter's other PHPUnit-internal boundary points).

#15 DSN credentials (shared with testo#19)

redis://user:pass@host had its userinfo silently dropped (connection without AUTH). Now rejected; the error never echoes the DSN.

Verification

  • composer build green — 99 tests, 2985 assertions, psalm 100%.
  • Infection on the three changed files: MSI 95% (gate 90). The one new escape is the constructor's = false default, which forAll() always overrides explicitly.

Sister issue

DSN credentials in the Testo adapter: rasuvaeff/property-testing-testo#19.

- forAll() derives the property id from its caller; called from a helper (not
  the test method) that id names the helper, so every test using the helper
  shares one corpus entry and overwrites the others' counterexample. It now
  warns on stderr, like a closure-derived id already did; ->id() silences it.
  The signal is a mismatch between the derived method and TestCase::name().
- RedisDsn rejects a DSN carrying userinfo instead of dropping it (the
  connection would otherwise go without AUTH); the error never echoes the DSN.

Fixes #14
Fixes #15
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ba0882f1-164b-4f9d-84b4-a68802d06192


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Resolving runs once per property; a Redis suite otherwise built a client and
opened a connection per property. Keeps corpus resolution at parity with
property-testing-testo 0.6.2.
@rasuvaeff
rasuvaeff merged commit ca85676 into master Aug 20, 2026
11 checks passed
@rasuvaeff
rasuvaeff deleted the fix/indirect-id-warning-and-dsn-credentials branch August 20, 2026 18:59
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.

Derived property-id collision prunes another test's live regression

1 participant