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

Ignoring type of object on assertion #1

Open
fesor opened this issue Jun 18, 2014 · 1 comment
Open

Ignoring type of object on assertion #1

fesor opened this issue Jun 18, 2014 · 1 comment

Comments

@fesor
Copy link

fesor commented Jun 18, 2014

For example if we expecting JSON collection, but server response contains hash object, they will be equal.

For example we expecting:

['Foo', 'Bar']

And server response was

{"0": "Foo", "1": "Bar"}

This is caused by ignoring typo of JSON object. When you use json_decode($json, false); it will return array for expecting value and stdObject for actual value. But assertion uses json_decode($json, true);, so both expected and actual values will be converted to simple array with integer keys and they will be equal.

@Michael-vb
Copy link
Contributor

commit > push
what the problem?)

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

No branches or pull requests

2 participants