Skip to content

feat(assert): add public custom assertion records - #400

Draft
viktorprogger wants to merge 1 commit into
php-testo:1.xfrom
viktorprogger:issue-275-custom-assertions
Draft

viktorprogger wants to merge 1 commit into
php-testo:1.xfrom
viktorprogger:issue-275-custom-assertions

Conversation

@viktorprogger

Copy link
Copy Markdown
Contributor

Summary

  • Add public Assert::success() and Assert::failure() entry points for userland custom assertions.
  • Reuse Testo's existing assertion history, failure reporting, expectation handling, and fiber isolation.
  • Make AssertionException and ComparisonFailure supported public failure records, with validation before history mutation.
  • Add feature, negative, and concurrency coverage; document the API and the intentionally unsupported Rector conversion.

Closes #275

Verification

  • PHP 8.4.5 container lint for the changed PHP files: passed.
  • Focused Testo suite:
    vendor/bin/testo --json --path='plugin/assert/tests/Feature/CustomAssertionsTest.php'
    — passed: 11 tests, 57 assertions.
  • git diff --check: passed.
  • The PHP 8.2 container is available for linting, but the installed Composer dependencies require PHP >= 8.4.1.
  • The full assertion suite was not used as a local merge gate; a broader container run previously aborted in an existing Revolt isolation test. The focused custom-assertion suite is green.

Expose additive success and failure entry points for userland assertions while preserving the existing history, reporting, expectation, and fiber-isolation paths. Document the public contract and leave unsupported Rector conversion explicitly unregistered.

Assisted-By: OpenAI Codex <noreply@anthropic.com>
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.

Provide a public API for custom assertions

1 participant