Skip to content

Do not use anymore child matcher errors in Json/XML matchers #172

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

Merged
merged 4 commits into from
Aug 15, 2019

Conversation

norberttech
Copy link
Member

@norberttech norberttech commented Aug 15, 2019

This PR goal is to increase verbosity of Json/XML matchers error messages. It also deprecates SimpleFactory in favor of MatcherFactory (simple was terrible name) and simplifies factory building process.

@@ -113,7 +112,7 @@ public function test_error_when_path_in_nested_value_does_not_exist()

$this->assertFalse($this->matcher->match($value, $pattern));

$this->assertEquals($this->matcher->getError(), 'There is no element under path [foo][bar][faz] in value.');
$this->assertEquals($this->matcher->getError(), 'Value {"foo":{"bar":[]}} does not match pattern {"foo":{"bar":{"faz":"faz value"}}}');
Copy link
Member Author

Choose a reason for hiding this comment

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

this potentially might look opposite to increasing verbosity but I'm planning to create matcher backtrace that will let all matchers to put each operation into the backtrace, currently in most cases errors from JSON/XML matcher does not make any sense except situations like this one (it is handled in special way).

@norberttech norberttech merged commit f4232a5 into coduo:master Aug 15, 2019
@norberttech norberttech deleted the feature/json-errors branch August 15, 2019 10:18
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.

1 participant