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

Discuss a misleading message: "Value expected to be 'array', 'array' given." #92

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/Schema/Keywords/TypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function validDataProvider() : array
['string', null, 'string value'],
['object', null, ['a' => 1]],
['array', null, ['a', 'b']],
['array', null, ['0' => 'a', '2' => 'b']], // this triggers: "Value expected to be 'array', 'array' given."
Copy link
Member

Choose a reason for hiding this comment

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

actually object given should be raised here. but we have an issue about this already, I hope

Copy link
Member

Choose a reason for hiding this comment

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

yea, this one #25

['boolean', null, true],
['boolean', null, false],
['number', null, 12],
Expand Down Expand Up @@ -78,6 +79,7 @@ public function invalidDataProvider() : array
['string', 12],
['object', 'not object'],
['array', ['a' => 1, 'b' => 2]], // this is not a plain array (a-la JSON)
['array', ['0' => 'a', '2' => 'b']], // this is not an array anymore
['boolean', [1, 2]],
['boolean', 'True'],
['boolean', ''],
Expand Down