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

Enhancement: Implement validate() and return result with error messages #268

Merged
merged 1 commit into from
Apr 19, 2020

Conversation

localheinz
Copy link
Member

This PR

  • implements SchemaValidator::validate() and returns Result with error messages

@codecov
Copy link

codecov bot commented Apr 19, 2020

Codecov Report

Merging #268 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##              master      #268   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       147       161   +14     
===========================================
  Files             33        34    +1     
  Lines            472       521   +49     
===========================================
+ Hits             472       521   +49     
Impacted Files Coverage Δ Complexity Δ
...on/NormalizedInvalidAccordingToSchemaException.php 100.00% <100.00%> (ø) 3.00 <2.00> (+1.00)
...tion/OriginalInvalidAccordingToSchemaException.php 100.00% <100.00%> (ø) 3.00 <2.00> (+1.00)
src/SchemaNormalizer.php 100.00% <100.00%> (ø) 32.00 <0.00> (ø)
src/Validator/Result.php 100.00% <100.00%> (ø) 4.00 <4.00> (?)
src/Validator/SchemaValidator.php 100.00% <100.00%> (ø) 10.00 <8.00> (+8.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 85a4a1f...61cb762. Read the comment docs.

@ergebnis-bot ergebnis-bot self-requested a review April 19, 2020 12:20
@ergebnis-bot ergebnis-bot self-assigned this Apr 19, 2020
@localheinz localheinz merged commit 766c037 into master Apr 19, 2020
@localheinz localheinz deleted the feature/result branch April 19, 2020 12:22
@@ -27,13 +27,25 @@ public function testDefaults(): void
$exception = new NormalizedInvalidAccordingToSchemaException();

self::assertSame('', $exception->schemaUri());
self::assertSame([], $exception->errors());
}

public function testFromSchemaUriReturnsNormalizedInvalidAccordingToSchemaException(): void

Choose a reason for hiding this comment

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

nit:

-    public function testFromSchemaUriReturnsNormalizedInvalidAccordingToSchemaException(): void
+    public function testFromSchemaUriAndErrorsReturnsNormalizedInvalidAccordingToSchemaException(): void

as done in the other file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants