Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define expectations for exception messages #27

Closed
lcobucci opened this issue May 5, 2020 · 0 comments · Fixed by #67
Closed

Define expectations for exception messages #27

lcobucci opened this issue May 5, 2020 · 0 comments · Fixed by #67
Labels
Improvement Improvement of existing feature
Milestone

Comments

@lcobucci
Copy link
Member

lcobucci commented May 5, 2020

The tests which cover invalid data for annotations are allowing some mutations to exist:

x) src/Validator.php:33    [M] Throw_

--- Original
+++ New
@@ @@
     public function requiredScalar(string $attribute, string $type, $value) : void
     {
         if ($value === null) {
-            throw AnnotationException::requiredError($attribute, $this->annotation, $this->context, $type);
+            AnnotationException::requiredError($attribute, $this->annotation, $this->context, $type);
         }
         $this->verifyType($attribute, $type, $value);
     }

That happens because of an exception of the expected type is thrown by Validator#verifyType(). We should add the expected exception message and be able to remove these mutations.

@lcobucci lcobucci added the Improvement Improvement of existing feature label May 5, 2020
@lcobucci lcobucci added this to the 0.4.0 milestone May 5, 2020
@lcobucci lcobucci mentioned this issue Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Improvement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant