-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
type/bugSomething is brokenSomething is brokenversion/10Something affects PHPUnit 10Something affects PHPUnit 10version/11Something affects PHPUnit 11Something affects PHPUnit 11version/12Something affects PHPUnit 12Something affects PHPUnit 12
Description
It is currently impossible to implement a custom Constraint without triggering a static analysis error:
------ --------------------------------------------------------------------------------------------------------------------------------------
Line test/unit/Domain/Chat/MessageConstraint.php
------ --------------------------------------------------------------------------------------------------------------------------------------
26 Call to method __construct() of internal class PHPUnit\Framework\ExpectationFailedException from outside its root namespace PHPUnit.
🪪 method.internalClass
26 Instantiation of internal class PHPUnit\Framework\ExpectationFailedException.
🪪 new.internalClass
39 Call to method __construct() of internal class PHPUnit\Framework\ExpectationFailedException from outside its root namespace PHPUnit.
🪪 method.internalClass
39 Instantiation of internal class PHPUnit\Framework\ExpectationFailedException.
🪪 new.internalClass
------ --------------------------------------------------------------------------------------------------------------------------------------
Expected behavior
ExpectationFailedException should not be marked as internal, or Constraint should allow throwing other kind of exceptions.
mvorisek
Metadata
Metadata
Assignees
Labels
type/bugSomething is brokenSomething is brokenversion/10Something affects PHPUnit 10Something affects PHPUnit 10version/11Something affects PHPUnit 11Something affects PHPUnit 11version/12Something affects PHPUnit 12Something affects PHPUnit 12