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

ArrayContainsComparator do not Intersect correctry Empty expected nested array #5303

Closed
malinink opened this issue Dec 19, 2018 · 0 comments · Fixed by #5304
Closed

ArrayContainsComparator do not Intersect correctry Empty expected nested array #5303

malinink opened this issue Dec 19, 2018 · 0 comments · Fixed by #5304

Comments

@malinink
Copy link
Contributor

What are you trying to achieve?

I'm trying to use seeResponseContainsJson.
I have expected response like:
(assume that 'expectedKey' must present and be array, but I do not want to verify any content ):

[
    'expectedKey' => [],
];

Real Response like:

[
    'expectedKey' => ['foo' => 'bar'],
    'otherKey' => true,
];

I expect that seeResponseContainsJson finished correctly.

What do you get instead?

Got Responses differs, and diff does not contains 'expected' info.

- Expected | + Actual
@@ @@
+        'otherKey' => true
)

Details

  • Codeception version: 2.5.1
  • PHP Version: 7.2
malinink added a commit to malinink/Codeception that referenced this issue Dec 19, 2018
DavertMik pushed a commit that referenced this issue Dec 30, 2018
…ted array (#5304)

* Provide test for empty nested array Intersect case #5303

* Fix ArrayContainsComparator to intersect empty arrays correctly #5303
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 a pull request may close this issue.

1 participant