Skip to content

Fix expects abstract constraint validator test case#38

Merged
frankdekker merged 9 commits into123inkt:masterfrom
cardoso123inkt:fix-expects-abstract-constraint-validator-test-case
Feb 12, 2026
Merged

Fix expects abstract constraint validator test case#38
frankdekker merged 9 commits into123inkt:masterfrom
cardoso123inkt:fix-expects-abstract-constraint-validator-test-case

Conversation

@cardoso123inkt
Copy link
Copy Markdown
Contributor

Update AbstractConstraintValidatorTestCase::assertHandlesIncorrectConstraintType() to create a Stub instead of a mock

Copilot AI review requested due to automatic review settings February 11, 2026 13:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the AbstractConstraintValidatorTestCase test helper class by making three key improvements: switching from a mock to a stub for the Constraint object in incorrect constraint type tests, adding defensive expectations to prevent unintended method calls, and standardizing the use of self:: over static:: for consistency.

Changes:

  • Replace createMock() with createStub() for Constraint objects in assertHandlesIncorrectConstraintType() to better reflect the intended usage (the Constraint object shouldn't have method calls verified)
  • Add expectations to ensure no methods are called on executionContext and violationBuilder in scenarios where they shouldn't be used
  • Standardize from static:: to self:: for test expectations throughout the file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Symfony/AbstractConstraintValidatorTestCase.php
@frankdekker frankdekker merged commit f5be59c into 123inkt:master Feb 12, 2026
29 of 30 checks passed
@cardoso123inkt cardoso123inkt deleted the fix-expects-abstract-constraint-validator-test-case branch February 17, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants