Skip to content

Fixes to the arrayIntersectAssocRecursive() of REST module #837

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 2 commits into from
Jan 30, 2014

Conversation

deniskrasilnikov
Copy link
Contributor

Two fixes to the arrayIntersectAssocRecursive() used by seeResponseContainsJson(). Bugs appeared when trying recursively match json data inside the collection of similar-looking json items. E.g. assume api responds the below json collection of web-developer info:

 Array
(
    [0] => Array
        (
            [user] => Blacknoir
            [age] => 27
            [tags] => Array
                (
                    [0] => wed-dev
                    [1] => php
                )

        )

    [1] => Array
        (
            [user] => John Doe
            [age] => 27
            [tags] => Array
                (
                    [0] => web-dev
                    [1] => java
                )

        )

)
  1. Such $I->seeResponseContainsJson(array('tags' => array('web-dev', 'java'))) test would fail. Fixed at dbb68a1
  2. Such $I->seeResponseContainsJson(array('user' => 'John Doe', 'age' => 27)) test would fail. Fixed at 476d3c0

test: added more complex unit test case to test recursive intersection over json items collection
… of partial data match

test: test case which covers the fixed issue
DavertMik added a commit that referenced this pull request Jan 30, 2014
Fixes to the arrayIntersectAssocRecursive() of REST module
@DavertMik DavertMik merged commit 6371756 into Codeception:1.8 Jan 30, 2014
@DavertMik
Copy link
Member

Great! Really good patch. I hope that will help with REST testing. Merging it.
And starting to release 1.8.2 !

@deniskrasilnikov deniskrasilnikov deleted the rest-module-fix branch November 4, 2017 16:17
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.

2 participants